You are here:  » Quirky Parsing


Quirky Parsing

Submitted by christoperj23 on Tue, 2008-08-19 19:26 in

Im trying to create a new rss parse that will parse my facebook status feed. . . . But it seems to be silently erroring out. .

-- when i use the demo side from the website, and put the feed (http://www.facebook.com/feeds/status.php?id=517044001&viewer=517044001&key=bf79dc01a2&format=rss20) directly -- it parses it without any problem. And it gives me the *default code* that will echo out the entries from the arrays when i use it on my end. . .

. . . but when i use it on my end, it wont. I get no response. When i try to put a dummy varable into the function to echo a test string -- it doesnt

When i put a global to carry out the dummy varable out of the function -- i get nothing

When i put a second dummy varable outside of the function, to process after the parsing -- i *do* get that

I originally thought it was something on my end, maybe magicparser.php being in the wrong spot/etc -- but i checked my other parse scripts -- and they're still working. . .

ANY HELP WILL BE APPRECIATED. . . between my current scripts continuing to work. . . and the new one failing (despite working on the webpage -- and despite using the exact test code from the webpage) --im kinda at a loss. . .

Submitted by support on Tue, 2008-08-19 19:32

Hi,

This is almost certainly because URL Wrappers are not enabled on your PHP installation, which is how fopen() can open URLs (which is what MagicParser_parse() does).

Please see the following thread for more info and links to the PHP documentation about this:

http://www.magicparser.com/node/189

You can run a little test script to confirm that this is the case as follows; using your URL:

<?php
  $url 
"(http://www.facebook.com/feeds/status.php?id=517044001&viewer=517044001&key=bf79dc01a2&format=rss20)";
  
$fp fopen($url,"r");
  if (
$fp)
  {
    print 
"Success!";
  }
  else
  {
    print 
"Could not open URL";
  }
?>

If that fails, another test worth trying is to attempt the same thing with the BBC News RSS feed, so change it as follows:

  $url = "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml";

Hope this helps!
Cheers,
David.

Submitted by christoperj23 on Tue, 2008-08-19 20:25

David,

Thanx for the quick response. . .

That test code failed out with the error message you were expecting. . .

Where im at now is that i dont understand why the url pull would not be working on the facebook rss url -- but it would with on my other scripts. . .

For example: www.christoperj.com/phpys/forecast.php >>> pulls from >>>> http://a5574682774.api.wxbug.net/getFullForecast.aspx?acode=A5574682774&zipcode=76207&StationID=DNTNP

And that script is working as designed. . . But when i put that web url into the test script in your last thread -- i get the same failure error. . . (eventhough as i mentioned before, the forecast script is working)

Any other ideas?

Submitted by support on Tue, 2008-08-19 21:04

Hi,

Did you try the test script with the BBC feed?

The script that you are saying does work; is that running on a different server?

Thanks,
David.

Submitted by christoperj23 on Tue, 2008-08-19 21:14

yes sir, tried it with the bbc feed -- but it failed

And yes sir, with the other forecast.php script feed -- that one does indeed work

It's all really weird. . . i also tried cleaning it through feedburner, thinking that there was some garbage in the format that feedburner would strip before handing it off. . . but no joy.

also tried converting it to a different format in feedburner before handing it off to my server -- but no joy

(though it all worked through the magic parser website)

That all said -- ive got twitter and facebook linked, so i tried through the twitter rss status feed -- http://twitter.com/statuses/user_timeline/15378747.rss . . . . and that one *worked*. . .

So im even more confused. . .best i can tell is that there must be some character or something in the facebook feed that is kerplunking the parser function. . .but i dont have a clue what that would be.

Im good with the twitter link, the immediate objective is met with that. If you want to troubleshoot further, let me know. i'll be happy to test anything you send my way -- or for that matter, give you any information on my end you want to know

thanx again for your feedback