| Latest discussions |
|---|
|
Liperbox: Wordpress - Ipernity - Plugin to integrate Ipernity
Updated 5 weeks ago 1 reply |
|
Lightroom export plugin?
Updated 5 months ago 13 replies |
|
Wordpress widget
Updated 5 months ago 2 replies |
|
doc.set problems?
Updated 6 months ago 2 replies |
|
How to get the full list of my doc ids?
Updated 7 months ago 3 replies |
|
Uploadingtool for linux for flickr and ipernity in cooperation
Updated 8 months ago 3 replies |
|
(beginner) work on a Python API
Updated 8 months ago |
|
.NET API kit
Updated 9 months ago 2 replies |
|
Ipernity and SVG
Updated 9 months ago 12 replies |
|
How to get original-sized pictures via API?
Updated 9 months ago 8 replies |
| ... view all the discussions |
|
Ipernity::API for Perlposted by DoomshammerPosted on Sunday October 12, 2008 at 13:59. 437 visits. ( permalink ) |
This topic has been edited by Doomshammer 14 months ago.
You must be logged on to post a reply. Sign in now?
Latest comments
–
Subscribe to the comment feed for this topic.
- the authurl sub should also work without a frob. The frob is only necessary for desktop apps. This will save a preliminary/unecessary request to the API.
- the authurl should accept more permissions : perm_doc, perm_blog, perm_network & perm_profile.
- in auhtoken : why do you save $self->frob ? the frob can only be used once. Also a good idea would be to save the token.
- last thing, I don't really get how you handle errors
Anyway, I haven't tested it, just read the code. I'll give it a try on monday.
Kind regards.
Doomshammer replies:
I've just updated the code and cleaned it up a bit. I will review you comments during the next days and update the package accordingly. Errors are handled now.
Winni
Changelog:
# cvs log -r 1.3 lib/Ipernity/API.pm
cvs log: nothing known about 1.3
RCS file: /wne-cvs/Ipernity-API/lib/Ipernity/API.pm,v
Working file: lib/Ipernity/API.pm
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 1
description:
----------------------------
revision 1.3
date: 2008-10-12 19:11:33 +0000; author: doomy; state: Exp; lines: +47 -35; commitid: UiqNa7UoInrW4nmt;
- Replaced Twig::XML through XML::Simple
- Cleaned up of fetchfrob() and authtoken()
- Added response verification
- Return the XML as hash via execute_xml()
=============================================================================
Doomshammer says:
I've fixed the authtoken() and the authurl() permission issue. But I am getting stuck with the "non-frob" part. I actually have that part working, but if I do not issue a frob, i need to send a callback URL. Unfortunately the documentation here is not exact on how this works: www.ipernity.com/help/api/auth.web.html
Can you help me how to get the callback working with the URL? Here is what I tried:
www.ipernity.com/apps/authorize?api_key=12345670002719a49c702400051c7a&callback=http://www.heise.de&api_sig=f4c5f5f250e1af3f5bc722534554564
(Numbers in the URL have been changed)
But it is telling me s. th. in french, which I cannot translate but it looks like an error. Any idea?
Thanks
Winni
Doomshammer replies:
Doomshammer says:
Doomshammer says:
Latest version is 0.05: blog.pebcak.de/tmp/Ipernity-API-0.05.tar.gz
I've been playing a little bit with the perl API kit. It's working great.
Here are some thoughts about it :
- why do you need to scope the API constructor arguments into 'args'=>{...}? I think a API->new({'api_key'=>"XXXX",'secret'=>"YYY",...}); would look nicer.
- it seems to me that you're not always checking the possible errors / or that it is not easy to check the error code and message returned after an execute.
- in the CheckResponse sub, you should test if status ne "ok" - it's the only way to make sure it is not "ok" ;)
- I would prefer to have the "execute" function to return : success = true/false, response (the XML), and maybe the method called + parameters. With this I'm always sure if I need to check or not the XML response. Or didn't I understand how you do that...
Anyway, here is mostly cosmetic suggestions, it's great to have you working on this perl kit.
Thanks.
Doomshammer replies:
- The "args" part in the constructor I added actually to make the arguments sorted in a "subhash". But you are right, it might be easier to have them in the main constructor. I will change this in the next version.
- Well, that is actually what I expected. The CheckResponse() sub is meant to check for errors. If the user/programmer does like to have his own error verification, it is possible by not using the CheckResponse funciton. But all functions which provided non-raw output to the user verify the response for an error by using the CheckResonse() funciton
- Yep, the CheckReponse() ne 'ok' I already changed. I agree ;-)
- The "execute" function is actually meant to return the pure server response, so the programm has full access to it. But I will add your suggestion to the execute_xml() function which will verify the response from the server and return an hashref (I should also rename it to execute_hashref() as the _xml() is misleading).
Thanks again for your suggestions. I'll let you know when the new version is online.
Winni
Doomshammer replies: