Skip to content

Instantly share code, notes, and snippets.

@mgng
Created September 10, 2014 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgng/ed2b596eb5f640269b27 to your computer and use it in GitHub Desktop.
Save mgng/ed2b596eb5f640269b27 to your computer and use it in GitHub Desktop.
rss_demo.php
<?php
$rss = file_get_contents( "http://instagrss-mgng.rhcloud.com/parishilton" );
$xml = simplexml_load_string( $rss );
foreach( $xml->channel->item as $item ) {
print_r( array(
"title" => (string)$item->title,
"link" => (string)$item->link,
"description" => (string)$item->description,
"subject" => (string)$item->children("dc", true)->subject,
"creator" => (string)$item->children("dc", true)->creator,
"date" => (string)$item->children("dc", true)->date,
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment