Ooo... yeah, that was a fun one.  Here's the chunk of code from my client
that parses the (non-Twitter) API feed for the image url, along with other
items.  I'm using the SimplePie library.

> // Parse it
>
> $feed = new SimplePie();
>
> $feed->set_feed_url($url);
>
> $feed->enable_cache(false);
>
> $feed->init();
>
> $feed->handle_content_type();
>
>
>> $tweets = $feed->get_items();
>
>
>> foreach($tweets as $tweet)
>
> {
>
> //print_r($tweet);
>
> preg_match('([0-9]{1,})', $tweet->get_id(), $matches);
>
>
>> $tweet_id = $matches[count($matches)-1];
>
> $username = substr($tweet->get_title(), 0, strpos($tweet->get_title(),
>> ":"));
>
>
>> $text = str_replace($username.": ", "", $tweet->get_title());
>
> $tmp = $tweet->get_item_tags("http://rdfs.org/sioc/ns#";, "has_creator");
>
> $profile_url = $tmp[0]['attribs']['
>> http://www.w3.org/1999/02/22-rdf-syntax-ns#']['resource'];
>
>
>> preg_match('([0-9]{1,})', $profile_url, $matches);
>
> $profile_external_id = $matches[0];
>
>
>> $tmp = $tweet->get_item_tags("http://laconi.ca/ont/";, "postIcon");
>
> $image_url = $tmp[0]['attribs']['
>> http://www.w3.org/1999/02/22-rdf-syntax-ns#']['resource'];
>
>
>> .........
>
>
>> }
>
>
On Mon, Sep 22, 2008 at 9:33 AM, Daniel J Farrell <[EMAIL PROTECTED]>wrote:

> Hello,
>
> Is there an easy way to access the avatar images associated with each
> entry in an users 'all' or 'replies' feed? I noticed that avatar
> access is still to be implemented in the API. Do you know when it will
> be ready?
>
> Please tell me if this is barbaric but to get user images into my
> desktop client for identi.ca I was going to write code that parses the
> user-name from each feed entry, navigates to the associated profile
> page, and extracts the URL from the profile_avatar div. Is there a
> better way?!
>
> Cheers,
>
> Dan.
> _______________________________________________
> Laconica-dev mailing list
> [email protected]
> http://mail.laconi.ca/mailman/listinfo/laconica-dev
>
_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev

Reply via email to