How do I display the latest Flickr OAuth embedded image on the frontpage?

I have a Flickr category among my blogposts where I just paste in the direct links from Flickr, and let OAuth do it's thing to hotlink/embed the photos in the post.

On my frontpage I am trying to grab the latest hotlinked/embedded photo from the latest post in the Flickr category in order to display it there. But with no success. I've tried with the get_the_image(); plugin, but it seems to only read photos that have been inserted into the post using the wordpress gallery.

I manage to get the_title();, so I know I'm accessing to the right category and post, but I don't have any chance of displaying the image. Does anyone know how I can achieve this?

Update: I've achieved this with the following code:

query_posts('category_name=flickrshowposts=1');
if ( have_posts() ) : while ( have_posts() ) : the_post();

$meta = get_post_custom();      
$photos = array();
foreach ($meta as $key = $value)
    if (false !== strpos($key, 'oembed'))
        array_push($photos, $value[0]);                 
    if(preg_match('/src="(.+\.jpg)"/i', $photos[0], $m)) {
        echo 'img src="' . $m[1] . '" /';
    }

endwhile;
endif;

Unfortunatly that embeddes the full size image from Flickr. I tried combining it with TimThumb, but with no success. Small steps...

Topic flickr Wordpress

Category Web


Embeds are cached in hidden custom fields of a post. You can retrieve all keys with get_post_custom() of latest post and loop through it, looking for array key that starts wih _oembed_.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.