Wednesday, 23 February 2011

Using PHP to Parse external RSS file.

I have written a basic script to parse RSS, at the moment it parses a external twitter RSS:
PHP:



   Show RSS Document 



 and
  • functions
    print "
      \n"; foreach ($twitterxml->channel->item as $twitteritem) { print "
    • $twitteritem->title
    • \n"; } print "
    ";

    ?>




  • HTML Produced, putting the twitter feed into a list, this can not be customized using CSS styles:
    
    
    
       Show RSS Document 
    
    
    
    
    • ches_cat: about to go off to uni... time for some film philosophy
    • ches_cat: is about to get started on this essssayyyyyyyyy!
    • ches_cat: yooooo
    • ches_cat: also sopranos what an awesome show! where has it been all my life?
    • ches_cat: is about to sleep
      lots to think about - dissertation, my web project and a philosophy exam! But was happy to get a 69 for his exam!!
    • ches_cat: yo
    • ches_cat: hello
    • ches_cat: hi
    • ches_cat: i am sitting in the su with ant, marta and aggi
    • ches_cat: enjoyed misfits. whos the masked dude??
    • ches_cat: doesn't like gin anymore :'(
    • ches_cat: loved 'how to train your dragon' ace animation!
    • ches_cat: whos watching?
    • ches_cat: has just finished his second run of the week, a bit hard this time. getting cold.
    • ches_cat: is going to have a cup of tea with nem. woop.
    • ches_cat: is feeling a lot better. roll on game studies presentation.
    • ches_cat: is feeling ill :(
    • ches_cat: has just been on a run, feels energized!!!
    • ches_cat: is ready to start the week! still slightly hung-over though.
    • ches_cat: is hungovvvver

    Next step is to interlink two RSS files, one twitter feed, and then one image.

    No comments:

    Post a Comment