Allow sending multiple urls to API
It would cut a lot of bandwidth and other costs of making calls to the API (for you and the API users) if you allowed calls to the API to inquire about more than one url per call.
The guys from "Long URL Please" have implemented a feature like that by allowing more than one q parameter in their querystring, for example:
http://www.longurlplease.com/api/v1.1...
I would love to do a:
http://api.longurl.org/v1/expand?url=...
The guys from "Long URL Please" have implemented a feature like that by allowing more than one q parameter in their querystring, for example:
http://www.longurlplease.com/api/v1.1...
I would love to do a:
http://api.longurl.org/v1/expand?url=...
1
person likes this idea
I like this idea!
Tell me when this idea gets some attention.
The more people who like this idea, the more it gets noticed.
The more people who like this idea, the more it gets noticed.
The company has this under consideration.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?I had thought about adding support for this in the past. I have plans for a version 2 of the API, so thanks for bringing it up again. I'll see what I can do. ;-)
-
Inappropriate?Thinking about this more, I'm inclined not to implement it.
Because of the very nature of my service (relying on calls to external websites and APIs), it is possible for a request to take up to 30 seconds to process before timing out, not because my servers are slow, but because a third-party server is slow. That is when expanding only one URL.
I fear that if I allow expanding more than one URL per request it could easily lead to more timeouts and a very bad user experience.
Perhaps I could talk to the guy at LongURLPlease and see what his experience has been. -
Inappropriate?...or, how about this?
Since we're talking about a process that isn't very cpu intensive, and instead is mostly about waiting idly for a reply from the other server. You might just open multiple urls in different processes (from one script) and than parse results for all of them.
So the script running would do something like that:
1. Call http://bit.ly/ra525 in process 1
2. Call http://digg.com/u119Y in process 2
3. Call http://tinyurl.com/corl9d in process 3
4. iterate over all three processes getting and parsing results.
5. return results.
So if process 1 would take 3 seconds, process 2 would take 2 seconds, and process 3 takes 3 seconds... The whole script would take 3 seconds and not 8.
Here's some sample PHP code I just Googled:
http://www.pyrosoft.co.uk/blog/2007/1...
I’m confident
-
Inappropriate?That's a good idea, but I'll still have to think about it. If I do end up doing it it probably wont be for a little while. There are a number of other things on my to-do list that take priority.
-
Inappropriate?Just to share my experience. I ended up developing a script that takes all the links I need to go over and create individual processes for digging each (just like in the code sample above) and it works great!
My script scans about 300 links at a time, and it finishes in about 20-30 seconds! An amazing improvement. (of course on a production machine, it really slows it down when doing something like that... I'm considering AWS for it).
My code is based on the link above, but if you'd like to see my code, I'd be happy to share it.
I’m confident
Loading Profile...


EMPLOYEE