September 20, 201015 yr Hey Everyone, I am using simple xml to load my tumblr posts on my web site. My site is at http://www.boyleswebdesign.com/Clients/NewJake/index.php5 . If you notice there are PHP errors on some of the posts. Why is this? Does anyone know how I can get it from getting these errors? Thanks everyone!
September 21, 201015 yr what errors? If you could elaborate more then people may be able to assist. I see 3 posts listed and none have PHP errors. The only problem I could see were a couple of images not showing in the somewhat annoying slider at the top of the page.
September 21, 201015 yr Author The error I am seeing says... Warning: simplexml_load_file(http://jakeboyles.tumblr.com/api/read?type=post&start=0&num=3) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable in /homepages/12/d178860016/htdocs/bwd/Clients/NewJake/index.php5 on line 107 and yeah I know about the slider. Im still working on it.
September 21, 201015 yr 503 Service Temporarily Unavailable usually refers to an issue on the web server, typically when it's too busy (overloaded) though not always. Are you running on an overcrowded server? Maybe contacting your host might pinpoint the problme.
September 21, 201015 yr Author I have it set up on a local server also and its getting 503's too. My code is... <li><h3>Tumblr Posts</h3></li> <li> <?php $request_url = "http://jakeboyles.tumblr.com/api/read?type=post&start=0&num=3" ; $xml = simplexml_load_file($request_url); $title = $xml->posts->post->{"regular-title"}; $post = $xml->posts->post->{"regular-body"}; $link = $xml->posts->post["url"]; $small_post = substr($post,0,67); echo "<h2 class='poststitle'><a href=".$link. ">" .$title. "</a></h2>" ; echo "".$small_post."..."; ?> </li> <li> <?php $request_url = "http://jakeboyles.tumblr.com/api/read?type=post&start=1&num=3" ; $xml = simplexml_load_file($request_url); $title = $xml->posts->post->{"regular-title"}; $post = $xml->posts->post->{"regular-body"}; $link = $xml->posts->post["url"]; $small_post = substr($post,0,67); echo "<h2 class='poststitle'><a href=".$link. ">" .$title. "</a></h2>" ; echo "".$small_post."..."; ?> </li> <li> <?php $request_url = "http://jakeboyles.tumblr.com/api/read?type=post&start=2&num=3" ; $xml = simplexml_load_file($request_url); $title = $xml->posts->post->{"regular-title"}; $post = $xml->posts->post->{"regular-body"}; $link = $xml->posts->post["url"]; $small_post = substr($post,0,67); echo "<h2 class='poststitle'><a href=".$link. ">" .$title. "</a></h2>" ; echo "".$small_post."..."; ?> </li> </ol> I am calling for the url 3 times right in a row. Would that overload it? Im not really sure how to get 3 posts from one script, if that makes sense.
Create an account or sign in to comment