Exemplo n.º 1
0
$query = array("per_page" => "500", "sort" => "date-posted-desc", "group_id" => "1011166@N22", "has_geo" => "true");
$search = $f->photos_search($query);
echo "f:";
print_r($search);
foreach ($search['photo'] as $photo) {
    $photoid_match = $photo['id'];
    //echo($photoid_match);
    //	if ($photo['id'] <= $since_id) continue;
    $idmatches = preg_grep("#{$photoid_match}#", $allflickrids);
    //	print_r($idmatches);
    if (sizeof($idmatches) > 0) {
        continue;
    }
    $owner = $f->people_getInfo($photo['owner']);
    $info = $f->photos_getInfo($photo['id']);
    $geo = $f->photos_geo_getLocation($photo['id']);
    //	print_r($info);
    $obslat = $geo['location']['latitude'];
    $obslng = $geo['location']['longitude'];
    $flickrid = quote_smart(htmlentities(strip_tags($photo['id'])));
    $obsdatetime = quote_smart(htmlentities(strip_tags($info['dates']['taken'])));
    $obstype = quote_smart('flickr');
    $obsemail = quote_smart(htmlentities(strip_tags($owner['username'])));
    $obsnotes = quote_smart(htmlentities(strip_tags($photo['title'])));
    $link_a = "http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'];
    $link = quote_smart($link_a);
    $photolink_d = 'http://farm' . $info['farm'] . '.static.flickr.com/' . $info['server'] . '/' . $info['id'] . '_' . $info['secret'] . '_m.jpg';
    savePhoto($photolink_d, $photo['id']);
    $photolink = quote_smart($photolink_d);
    $insert = sprintf("INSERT INTO icrows (id, flickrid, obsdatetime, obstype, flickrowner, obsnotes, obslat, obslng, link, photolink) VALUES ('',%s,%s,%s,%s,%s,%s,%s,%s,%s)", $flickrid, $obsdatetime, $obstype, $obsemail, $obsnotes, $obslat, $obslng, $link, $photolink);
    //	echo("$insert" . "\n<br>");