E
E
Evgeny Sheleg2011-04-01 12:51:23
PHP
Evgeny Sheleg, 2011-04-01 12:51:23

phpFlickr

Either it’s not my day, or in the internet, detailed information on this class really fell.

Found a bunch of examples how to show images. But I could not find a normal example and description for downloading.

It is necessary to upload an image (not local) and get a link to it.

I tried it myself, but it didn't work. It gives out "Oops! The API key or signature is invalid." then “Oops! Flickr can't find a valid callback URL.".

Help someone who has done this. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
L
Leonid Svyatov, 2011-04-01
@Svyatov

Show your code. Should be something like:
$f = new phpFlickr("key","secret");
$f->setToken("token");
$f->auth("write");
$upload_photo_id = $f->sync_upload($filePhotoName);

J
jabbarow, 2011-04-01
@jabbarow

It? naikom.ru/blog/archives/1647#more-1647

D
Drakula2k, 2011-04-01
@Drakula2k

Everything is described here . Including there is a link to a ready-made PHP system for work and their API.

E
Evgeny Sheleg, 2011-04-01
@Duti_Fruti

Svyatov, the same thing, but there is no line:
$f->setToken("token");
Where can I get a token?

E
Evikulov, 2013-11-21
@Evikulov

Ufff, I also racked my brains a little to figure it out, in general, everything is tricky here :)
1) CallbackUrl is indicated on the pages with your application http://www.flickr.com/services/apps/by/...
here you need to select the application, then in the right menu, find the admin item, and select edit, then the edit page will open and you will see the CallbackUrl there (somehow it seemed complicated to me).
2) Let's go to the code. To do something, we need to authorize our application in the code require_once("phpFlickr.php");
$f = new phpFlickr($apikey, $secret);
$f->auth("write");
after that, you will need to follow the link, allow the application to perform the necessary operations, and then go to your callbackurl, but with a token. Something like http://test.ru/?frob=your_token
3) We take the same token from the URL
and do the following
require_once("phpFlickr.php");
$f = new phpFlickr($apikey, $secret);
$f->setToken($token);
$f->sync_upload("test.jpg", $title = "the title", $description = "the description", $tags = "tag1,tag2");
It seems to work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question