Jump to content

XML Parsing problem from Tumblr


Andrew777

Recommended Posts

Can some please help me figure out why this isn't working?

 

Just trying to show a page on my site show photo posts from a tumblr account.

So I found this code to pull the XML data and then echo it on my page...

Here is the code but I'm just getting nothing...

 

<?php
    $request_url = "http://alexishoustonmusic.tumblr.com/api/read?start=0&num=1&type=text";
    $xml = simplexml_load_file($request_url);
    $post = $xml->posts->post->{‘regular-body’};
    echo '<h1>'.$post.'</h1>';
?>

I see there is a similar post here but that person didn't say how he fixed his problem...

I'm stumped...

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/278620-xml-parsing-problem-from-tumblr/
Share on other sites

Thanks for your response Requinix.
 

I tried to do the same (below) but still get nothing returned back showing up on the page...

Can you tell why my code below still isn't doing anything?

<?php
    $request_url = "http://alexishoustonmusic.tumblr.com/api/read?start=0&num=1&type=text";
    $xml = simplexml_load_file($request_url);
    $post = $xml->posts->post->{"regular-body"};
    echo "<h1>".$post."</h1>";
?>

Requinix: I will check on the error reporting to see if that helps thanks.

Boompa: I have looked at the Tumblr api and it's beyond my scope i guess, cause i don't get it.

xenLiam: I still get nothing on my page even though my code is still the same as you show in your screen shot...

 

This sucks, i may have to hire someone just to do this.....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.