Jump to content

Recommended Posts

Hello I am trying to get some specific information from my tumbler account so that i can re post it on my website.

 

This is what i have so far

<body>
        <div class="title">
                <?php
                        $request_url="http://jonccrawley.tumblr.com/api/read?post&start=1&num=1";
                        $xml=simplexml_load_file($request_url);
                        $title=$xml->posts->post->{'regular-title'};
                        echo $title
?>

</div>
        <div class="body">
                <?php
                        $body=$xml->posts->post->{'regular-body'};
                        echo $body;
                ?>
        </div>
<body>

 

And this is a copy of the xml i am trying to get ( http://jonccrawley.tumblr.com/api/read?post&start=1&num=1 )

 

<tumblr version="1.0">
     <tumblelog name="jonccrawley" timezone="US/Eastern" title="Jon C Crawley"/>

        <posts start="1" total="2">

             <post id="8744248203" url="http://jonccrawley.tumblr.com/post/8744248203"         url-with-slug="http://jonccrawley.tumblr.com/post/8744248203/new-project" type="regular" date-gmt="2011-08-10 19:50:12 [b]GMT" date="Wed, 10 Aug 2011 15:50:12"[/b] unix-timestamp="1313005812" format="html" reblog-key="Tyww6zGc" slug="new-project">
                       <regular-title>New Project.</regular-title>

                       <regular-body>
                       <p>Currently developing a website that will utilize linked in/tumbler/twitter/and Facebook.</p>

                        <p>And no nick not selling out with a template I&#8217;ll code it from the ground up <strike></strike></p>
                     </regular-body>
             </post>
      </posts>
</tumblr>

information in the post tag is what i am trying to get like (date/time).

<post id="8744248203" url="http://jonccrawley.tumblr.com/post/8744248203" url-with-slug="http://jonccrawley.tumblr.com/post/8744248203/new-project" type="regular" date-gmt="2011-08-10 19:50:12 [b]GMT" date="Wed, 10 Aug 2011 15:50:12"[/b] unix-timestamp="1313005812" format="html" reblog-key="Tyww6zGc" slug="new-project">
<regular-title>New Project.</regular-title>

 

Is their any way of doing this?

 

thank you for your time,

Jon c crawley

Link to comment
https://forums.phpfreaks.com/topic/244507-getting-xml-information/
Share on other sites

Thx Figured it out

<html>
<body>
        <div class="title">
                <?php
                        $request_url="http://jonccrawley.tumblr.com/api/read?post&start=1&num=1";
                        $xml=simplexml_load_file($request_url);
                        $title=$xml->posts->post->{'regular-title'};
                        echo $title
                ?>
        <div class="postdate">  
                <?php

                        $date=$xml->posts->post['date-gmt'];
                        echo $date;


                ?>
        </div>

</div>
        <div class="body">
                <?php
                        $body=$xml->posts->post->{'regular-body'};
                        echo "";
                        echo $body;
                ?>
        </div>
<body>
</html>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.