Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 681157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:27:09+00:00 2026-05-14T01:27:09+00:00

I am trying to create a social timeline. I pull in feeds form certain

  • 0

I am trying to create a social timeline. I pull in feeds form certain places so I have a timeline of thing I have done. The problem I am having is with Google reader Shared Items.

I want to get the time at which I shared the item which is contained in <entry gr:crawl-timestamp-msec="1269088723811"> Trying to get the element using $date = $xml->entry[$i]->link->attributes()->gr:crawl-timestamp-msec; fails because of the : after gr which causes a PHP error. I could figure out how to get the element, so thought I would change the name using the code below but it throws the following error

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "<?xml version="1.0"?><feed xmlns:idx="urn:atom-extension:indexing" xmlns:media="http://search.yahoo.com/mrss/" xmlns

<?php

$get_feed = file_get_contents('http://www.google.com/reader/public/atom/user/03120403612393553979/state/com.google/broadcast');

    $old = "gr:crawl-timestamp-msec";
    $new  = "timestamp";

    $xml_file = str_replace($old, $new, $get_feed);

    $xml = simplexml_load_file($xml_file);
    $i = 0;


        foreach ($xml->entry as $value)
        { 

            $id = $xml->entry[$i]->id;
            $date = date('Y-m-d H:i:s', strtotime($xml->entry[$i]->attributes()->timestamp ));
            $text = $xml->entry[$i]->title;
            $link = $xml->entry[$i]->link->attributes()->href;
            $source = "googleshared";

            echo "date = $date<br />";

            $sql="INSERT IGNORE INTO timeline (id,date,text,link, source) VALUES ('$id', '$date', '$text', '$link', '$source')";
            mysql_query($sql);

            $i++;
        }`

Could someone point me in the right direction please.

Cheers

Craig

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:27:10+00:00Added an answer on May 14, 2026 at 1:27 am

    The problem is because crawl-timestamp-msec is in a different namespace. Somewhere in the document (usually the root element, which looks to be <feed/> in your case), it will have an attribute along the lines of xmlns:gr="http://some/url/here". This says that the document will be using things from the http://some/url/here namespace, and will prefix all of these things with gr.

    [Edit: the URL in question is http://www.google.com/schemas/reader/atom/]

    To access it, you need to change

    $xml->entry[$i]->link->attributes()->gr:crawl-timestamp-msec

    to

    $xml->entry[$i]->attributes('http://www.google.com/schemas/reader/atom/')->{'crawl-timestamp-msec'}

    (Edit: the attribute is on the <entry/> element, not the <link/>, it seems)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a social network and I'm having a problem with my
I'm trying to create a social-network like feature in an app I'm building, and
I am trying to create a social network application using elgg.Since i am pretty
I'm trying to create a social media panel that sits next to the title
I'm trying to create a social-network like many-to-many mapping in SQLAlchemy. That is I
I have been trying to use django-allauth to provide Social registration, but I am
I am trying create a WCF service that leverages the WPF MediaPlayer on the
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I am trying create a delegate representation of constructor by emitting a Dynamic Method,
Ok so I am trying create a login script, here I am using PHP5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.