Combine 2 or more xml files, sort, dedup and display with php

Want to combine 2 or more xml/rss files with php? This commented code should get you started.

The 2 xml files will need to be structured the same in order for this to work without adding more code. The 2 in this example are from the same source with different filters selected. This allows me to sort, filter and dedup using my own methods. You can then re-create the xml or simply display it on the screen like the example does below.

If you still need help feel free to comment below.

Code and Example below

<?php
//Sort Function by title
function sortFunction( $a, $b )
{
return strtotime($b["title"]) - strtotime($a["title"]);
}

$urllist = array();
//Define new xml files here by adding a new line with different urls
$urllist[] = “http://www.instructables.com/tag/type-question/rss.xml?count=100&sort=RECENT”;
$urllist[] = “http://www.instructables.com/tag/type-question/rss.xml?count=100&sort=UNANSWERED”;

//Loop through urllist array adding each item to one multidimensional array
//Define array before populating
$items = array();
foreach($urllist as $url)
{
$feed = simplexml_load_file($url);

//these item names are the child names in the xml
//channel is the wrapper in the xml
foreach($feed->channel->item as $item)
{
$items[] = array(
‘link’ => (string)$item->link,
‘image’ => (string)$item->imageThumb,
‘title’ => (string)$item->title,
‘pubdate’ => (string)$item->pubDate,
‘author’ => (string)$item->author
);
}
}

//Sort by Title
usort($items, “sortFunction”);

//Remove Duplicates
$items = array_map(“unserialize”, array_unique(array_map(“serialize”, $items)));

//Loop through the list and display them
$ictr = 0;
foreach ($items as $item)
{
echo “<div style=’float:left; width:200px; height:300px; margin-right:15px; text-align:center;’>”;
echo “<a href='” . $item[‘link’] . “‘ target=’_blank’>”;

if(strpos($item[‘image’],”defaultIMG”))
{
echo “<img src=’http://www.instructables.com/static/img/footer/footer-robot.png’ />”;
}
elseif(strpos($item[‘image’],”com”))
{
echo “<img src='” . $item[‘image’] . “‘ />”;
}
else
{
echo “<img src=’http://www.instructables.com” . $item[‘image’] . “‘ />”;
}
echo ‘<br />’ . $item[‘title’] . ‘<br />’;
echo ‘By: ‘ . $item[‘author’] . ‘ On ‘ . $item[‘pubdate’] . ‘</a></div>’;
}
echo “<div style=’clear: both;’>&nbsp;</div>”;
?>


Example of the output:

[phpCombineXMLArticle1][/phpCombineXMLArticle1]

Episode 17: We’re Alive S4 C40 P3 – Monsters – What’s-a-Mata with the Pump?

Join Mick and RedBeard as we cover We’re Alive S4 C40 P3 Monsters – …The rain falls…

Come back Monday Dec 9th to hear our next cast interview!

http://www.zombiepodcast.com/

If you are enjoying the banter, check out the out-takes after the credits.   We also included a few extended segments this time!

We want you to be a part of the show so send us your theories, ideas and feedback. Talk with us on Facebook!  Be involved in the show: You can be involved in the show by emailing us text or audio recordings to werealive@mickred.com or by calling (424) Alive – 80 or (424) 254-8380 and leaving a voicemail that we will play on our show. You can even text us at (424) 254-8380.

Visit us at: MickRed.com

Shoutouts: @JKWest on Twitter

Check out @DeadReviews – Their Youtube Channel can be found here: http://www.youtube.com/walkingd3adnews

Music Credits Ghostpocalypse – 4 Temptress and Lone Harvest by Kevin MacLeod is licensed under a CC Attribution 3.0. http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100665http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100409.

Microwave Deathray

Magnetron
There is something called a Magnetron, not to be confused with Megatron,  inside your microwave. This is the primary component that vibrates the molecules of what you are heating in your microwave to generate heat. Mmmm in the words of Jim Gaffigan Haaaot Pocket!

Ok so it’s not necessarily a death ray but I wouldn’t want to put my junk in front of one. Ever heard of a herf gun? A herf gun is a directed energy weapon. Boeing’s CHAMP recently put on a show taking out targeted computers using one. Supposedly a crude herf gun can be built attaching a waveguide or horn antenna to the output of the magnetron.

Original video was pulled from Youtube updated 7/10/2016

https://www.youtube.com/watch?v=0mjua2e8Y7k

Someone else’s crazy project

Note from wiki “a 1.1 kilowatt input will generally create about 700 watts of microwave power”

What I’d like to do

  • Build a Faraday cage so that I can safely perform testing
  • Get one of these powered up with an inline dimmer switch so that I can control the output
  • Build a horn antenna to attach to the Magnetron so that I can control the direction of output
  • Use some equipment to measure the emitted power with in controlled area
  • Use a frequency counter to get a reading of what range is play
  • Cook food from a distance
  • Light up bulbs in a field
  • Destroy some electronics

Related Projects on Instructables

[phpInstrucatblesKeyword]keyword-plasma/keyword-microwave[/phpInstrucatblesKeyword]

Click here to browse through posts written about my interests in Microwave Projects

Interesting Finds

I found some interesting software on an MIT website today. There were 3 on this page that grabbed my attention.

STARCluster
StarCluster
“StarCluster is an open source cluster-computing toolkit for Amazon’s Elastic Compute Cloud (EC2)”. First off I didn’t realize Amazon’s distributed computing could be used like this. Then again I haven’t done much with parallel computing since early days with Beowulf clustering. If that doesn’t give enough of an indication this will, I used to get frustrated with some of the machines I had because they did not have math co-processors and most linux distributions at the time required them.

STARHPC
StarHPC
“StarHPC provides a virtual machine image configured for parallel programming in both OpenMP and OpenMPI technologies.” I love tinkering with custom linux distributions especially on a virtual machine. My first thought is that this would be fun to run on various embedded devices around the house.

STARHydro
StarHydro

“StarHydro is an application for distributed hydrological analysis. It allows the user to delineate watersheds and explore various watershed statistics.” Ok so this is probably my favorite find today. I love data especially when it involves the earth. I can’t wait to see someone make a complete computer model of the earth loaded up with live data fed from sensors all over the world.

Episode 16: We’re Alive S4 C40 P2 – Monsters

Join Mick and RedBeard as we cover We’re Alive S4 C40 P2 Monsters – …Where the Trial Began.. http://www.zombiepodcast.com/

If you are enjoying the banter, check out the out-takes after the credits.   We also included a few extended segments this time!

Well the scuba tank is possible with steel tanks http://www.youtube.com/watch?v=vWivPYuLiOE

We want you to be a part of the show so send us your theories, ideas and feedback. Talk with us on Facebook!  Be involved in the show: You can be involved in the show by emailing us text or audio recordings to werealive@mickred.com or by calling (424) Alive – 80 or (424) 254-8380 and leaving a voicemail that we will play on our show. You can even text us at (424) 254-8380.

 

Contributors @marcdavis87@Adamwcgy

Visit us at: MickRed.com

Shoutouts: @JKWest on Twitter

 

Check out @DeadReviews – Their Youtube Channel can be found here: http://www.youtube.com/walkingd3adnews

Music Credits Ghostpocalypse – 4 Temptress and Lone Harvest by Kevin MacLeod is licensed under a CC Attribution 3.0. http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100665http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100409.

Episode 15: We’re Alive S4 C40 P1 – Monsters

Join Mick and RedBeard as we cover We’re Alive S4 C40 P1 Monsters – …Ink on the page.. http://www.zombiepodcast.com/

If you are enjoying the banter, check out the out-takes after the credits.   We also included a few extended segments this time!

We want you to be a part of the show so send us your theories, ideas and feedback. Talk with us on Facebook!  Be involved in the show: You can be involved in the show by emailing us text or audio recordings to werealive@mickred.com or by calling (424) Alive – 80 or (424) 254-8380 and leaving a voicemail that we will play on our show. You can even text us at (424) 254-8380.

 

Contributors @marcdavis87@Adamwcgy

Visit us at: MickRed.com

Shoutouts: @JKWest on Twitter

 

Check out @DeadReviews – Their Youtube Channel can be found here: http://www.youtube.com/walkingd3adnews

Music Credits Ghostpocalypse – 4 Temptress and Lone Harvest by Kevin MacLeod is licensed under a CC Attribution 3.0. http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100665http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100409.

Sony Google TV Box Hack Research

Sony NSZ GT1
Sony NSZ GT1

This project is still in the first stages of research.

After waiting forever for Google to make negotiations successful and continue to workout bugs some media sources still do not work such as Hulu.

I have a Sony Google TV box model NSZ-GT1. My box has the 20120917 update installed which may not be possible to downgrade.

Hack process involves downgrading and installing modified update files.

Notes

Looks like someone leaked HC for the Sony NSZ-GT1

Quote:
This is a HC update with root for the NSZ-GT1 GoogleTV Bluray Player
http://www.multiupload.com/1SU4ZPXQP5

from: http://www.reddit.com/r/GoogleTV/comments/lilis/hc_update/

This build works great and contains root (if you remount adb).

Install Instructions:
1.) Download update and place on a thumb drive (at least 512MB capacity) in the root directory of the device.
2.) Plug thumb drive into NSZ-GT1.
3.) Enter Sony Recovery by first unplugging the power from the box, then while holding the power button plug in the power cable. Continue to hold the power button until the Sony Recovery menu displays.
4.) Choose “System update with USB” option (option #3).
5.) The device will ask you if you would like to upgrade, choose 1 for yes.
6.) The device will present a progress bar and will reboot when completed. (Do not turn off the box during this period)
7.) Enjoy HC on the sony NSZ-GT1

Thanks,
Zenofex

http://forum.gtvhacker.com/nsz-gt1/topic278.html?sid=de3418e15a95628fb2d66eb23d05bbaa

 

 

 

Turns out there is a check in place to limit browser and flash from accessing Hulu/CBS/NBC/ABC. (1)

Update.zip exploit (1)

package_list_;cd tmp; cd mnt; cd diskb1; sh t.sh; .zip
/package-updater.sh -l 0 -p /tmp/mnt/diskb1/package_list_;cd /tmp;cd /mnt;cd /diskb1;sh t.sh;.zip

“The command above involved a t.sh bash script (to meet filename size limitations) which spawned a shell over UART and telnetd. From there we proceeded to dump the recovery file system.”

Unfortunately this exploit was patched in the 7/2011 update

 

Reboot
Apply Update from USB (update.zip)
Wipe data/factory reset
Wipe cache partition
All update files provided are RSA verified before the box attempts installation

 

  1. DEFCON Xenofex Panel Hacking the GoogleTV

Episode 14: We’re Alive S4 Ch39 P3 Chemical Reactions – Melty Goodness

Join Mick and RedBeard as we cover We’re Alive S4 ch 39 P3 Chemical Reactions – Following the Trail. We want you to be a part of the show so send us your theories, ideas and feedback. Talk with us on Facebook! Be involved in the show: You can be involved in the show by emailing us text or audio recordings to werealive@mickred.com or by calling (424) Alive – 80 or (424) 254-8380 and leaving a voicemail that we will play on our show. You can even text us at (424) 254-8380.

Notes on Chemicals

  • Somatropin or Somatrophen – HGH
  • Stanozolol – synthetic anabolic steroid derived from dihydrotestosterone
  • Megace –
    • the act of performing good magic, sleight-of-hand, and illusion art of misdirection
  • “Arenis” – arena
    • Arene – a hydrocarbon with alternating double and single bonds between carbon atoms forming rings. The term ‘aromatic’ was assigned before the physical mechanism determining aromaticity was discovered, and was derived from the fact that many of the compounds have a sweet scent. The configuration of six carbon atoms in aromatic compounds is known as a benzene ring, after the simplest possible such hydrocarbon, benzene. Aromatic hydrocarbons can be monocyclic (MAH) or polycyclic (PAH).
  • Follistatin
    • activin-binding protein is a protein that in humans is encoded by the FST gene.
    • Follistatin is being studied for its role in regulation of muscle growth in mice.

Contributors @marcdavis87@Adamwcgy Visit us at: MickRed.com Shoutouts: @JKWest on Twitter Check out @DeadReviews – Their Youtube Channel can be found here: http://www.youtube.com/walkingd3adnews Music Credits Ghostpocalypse – 4 Temptress and Lone Harvest by Kevin MacLeod is licensed under a CC Attribution 3.0. http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100665http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100409.

Episode 13: We’re Alive S4 C39 P2 Chemical Reaction – Leaving a Trail

Join Mick and RedBeard as we cover We’re Alive S4 C39 P2 Chemical Reaction – Blood turns the tides. We want you to be a part of the show so send us your theories, ideas and feedback.

Talk with us on Facebook!

http://www.powerlabs.org/

Radon Labs
Common monofluoride are organofluorine compounds such as methyl fluoride and fluorobenzene. All the alkali metals form monofluorides.

Be involved in the show:
You can be involved in the show by emailing us text or audio recordings to werealive@mickred.com or by calling (424) Alive – 80 or (424) 254-8380 and leaving a voicemail that we will play on our show. You can even text us at (424) 254-8380.

Visit us at: MickRed.com

Shoutouts:
@JKWest on Twitter

Check out @DeadReviews – Their Youtube Channel can be found here: http://www.youtube.com/walkingd3adnews

Music Credits

Ghostpocalypse – 4 Temptress and Lone Harvest by Kevin MacLeod is licensed under a CC Attribution 3.0.
http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100665http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100409.

Episode 12: WAFancast Halloween Special

Join Mick & RedBeard for the We’re Alive Fancast Halloween special. We will be reading a few short stories that we hope you will enjoy.

When We were Kids – A Pegs FanFic
http://www.zombiepodcast.com/forum/showthread.php?3497-When-We-Were-Kids-A-Pegs-Fanfic

Negative Effect by Juliet Boyd
http://www.microhorror.com/microhorror/author/juliet-boyd/negative-effect/
http://www.julietboyd.com/home

Chiseled by Caelin Beaty
http://www.microhorror.com/microhorror/author/caelin-beaty/chiseled/

Visit us at: www.mickred.com Be involved in the show: You can be involved in the show by emailing us text or audio recordings to werealive@mickred.com or by calling (424) Alive – 80 or (424) 254-8380 and leaving a voicemail that we will play on our show. You can even text us at (424) 254-8380.

Music Credits

Ghostpocalypse – 4 Temptress and Lone Harvest by Kevin MacLeod is licensed under a CC Attribution 3.0.
http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100665http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100409.

“The Dread” Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
http://creativecommons.org/licenses/by/3.0/

“Plaint” Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
http://creativecommons.org/licenses/by/3.0/

“Long note One” Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
http://creativecommons.org/licenses/by/3.0/

“Long Note Three” Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
http://creativecommons.org/licenses/by/3.0/

“Classic Horror 2” Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
http://creativecommons.org/licenses/by/3.0/

Top