shortenURL not working #184
Labels
No labels
Bug
Enhancement
Feature Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/twython#184
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
shortenURL() is not working for me and return this message instead of the shorl URL:
Using the link given, i tried:
request = requests.get("http://is.gd/create.php", params = { 'format': 'simple', 'url': "www.google.com"})instead of:
request = requests.get("http://is.gd/api.php", params = { 'query': "www.google.com"})And it seems to be working as intended.
Did their API change or something? I admit it's not something we update
often. It dates back to a time when Twitter didn't auto-shorten URLs and
we've just kept it in for legacy reasons - apparently people still use it.
We'll take care of it.
On Fri, Apr 19, 2013 at 10:53 AM, Adrien Tronche
notifications@github.comwrote:
Skype: ryanmcgrathr
Twitter: http://twitter.com/ryanmcgrath/
Web: http://venodesigns.net/
GitHub: http://github.com/ryanmcgrath/
Would you like me to just fix this for the 2.8.0 release?
Sent from my iPhone
On Apr 19, 2013, at 10:54 AM, Ryan McGrath notifications@github.com wrote:
If you can fit it in go for it.
On Fri, Apr 19, 2013 at 10:55 AM, Mike Helmick notifications@github.comwrote:
Skype: ryanmcgrathr
Twitter: http://twitter.com/ryanmcgrath/
Web: http://venodesigns.net/
GitHub: http://github.com/ryanmcgrath/
@ryanmcgrath Looking at the function, it's not really dynamic. I got it to work with the current is.gd API, but we're forcing the param that is passed to the querysting, in
masterright now we're forcing the paramquery, what if the person usesbit.lyand their API does want thequeryparameter? You know what I mean?Should I fix this to accept optional params so it can be dynamic, or should I fix it then raise a
DeprecationWarning?@michaelhelmick I didn't make a pull request for that reason. I was thinking that changing params for
is.gdmight create problems for those who use another service that takes thequeryparam.Well, is.gd now takes the param "url" instead of "query"
http://is.gd/create.php?format=json&url=http://google.com
But, my issue is that the method in Twython
shortenUrlisn't dynamic.If someone wanted to shorten for bit.ly they need to use "query", point being, differently URL shorteners take different params and
shortenUrlisn't dynamic enough to handle them all.The new method would look like
The method is broken anyways, so I don't see a problem in changing it.
Then again, I feel like it's so ambiguous of a function.
What if the shortener they use doesn't return a JSON response, or only returns a normal text response.
I feel like there is no nice way to handle this without be so verbose in the method.
I purpose nixing the function and letting the user handle their own shortening with
requestsunless you can think of a nice way to implement it @ryanmcgrath ?The function was a convenience method from when Twitter didn't automatically shorten URLs. Being that they do this now, it's not a particularly important thing for the purposes of the library. While I would like to keep it for legacy purposes, it might be time to just kill it off - with requests it's easy enough for a developer to sling it on their own anyway.
Deprecate it.