|
Posted by Curt Zirzow on 10/04/00 11:37
On Sat, Jan 14, 2006 at 09:03:24AM -0700, Lists wrote:
>
> My goal is to take just the HTML for the image and link from the
> Flickr badge js script.
> ...
>
> <?
> // allow retrieval of external web source
> ini_set('allow_url_fopen',1);
>
> // get flickr js file
> $photo = file_get_contents("http://www.flickr.com/badge_code_v2.gne?
> count=1&display=latest&size=m&layout=h&source=user&user=91667218%
> 40N00");
>
> //get rid of all the crap except for the image tags
> ...
You're best aproach would be to look fo what you want. If all you
have to work with is some poorly written html doc and you want the
<a> <img> tag important parts?
preg_match('/<a href="([^"]+)".*?><img src="([^"]+)"/, $photo, $matches);
var_dump($matches);
Otherwise contact flicker and ask them for an API for what you are
trying to do. And if the above works dont expect it to work all the
time.
Curt.
--
cat .signature: No such file or directory
--
cat .signature: No such file or directory
Navigation:
[Reply to this message]
|