AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Library] bit.ly API
Goto page Previous  1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Voltron43



Joined: 27 Mar 2009
Posts: 76
Location: Dublin, IE

PostPosted: Sun Jun 21, 2009 1:19 pm    Post subject: Reply with quote

n-l-i-d wrote:
Could you add the "Optional Custom Name" option for when creating a short url?

Keywords are now supported in v0.1.2. It returns "The custom keyword you tried to use was already used by someone else" if the keyword is already used.
Code:
val := bitly_shorten("http://cnn.com","keyword","cnn")
Msgbox, % val

_________________
My Scripts
Back to top
View user's profile Send private message Visit poster's website
wadu
Guest





PostPosted: Sat Aug 29, 2009 6:16 pm    Post subject: You must be authenticated to access shorten Reply with quote

Not sure what I'm doing wrong but I keep getting
"You must be authenticated to access shorten".
I've tried with no user, with the bitlyapidemo and my own user and I keep getting the same message.
Back to top
Voltron43



Joined: 27 Mar 2009
Posts: 76
Location: Dublin, IE

PostPosted: Sat Aug 29, 2009 6:22 pm    Post subject: Re: You must be authenticated to access shorten Reply with quote

wadu wrote:
Not sure what I'm doing wrong but I keep getting
"You must be authenticated to access shorten".

It works for me when using Example I.

Code:
#Include bitlyAPI.ahk

login := "bitlyapidemo"
apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07"

val := bitly_shorten("http://cnn.com",1)
MsgBox, % val

Could you post the code that is giving you the error?
_________________
My Scripts
Back to top
View user's profile Send private message Visit poster's website
wadu
Guest





PostPosted: Sat Aug 29, 2009 7:23 pm    Post subject: Reply with quote

I think the problem lies within the url transformation. The method doesn't seem to do URL encoding but rather do a hex+base64 encoding.

The moment the url contains # or & the query starts to fall and in some cases, throws the authentication problem maybe due to the 'encoding' scheme.

Code:

#Include bitlyAPI.ahk

login := "bitlyapidemo"
apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07"

val := bitly_shorten("http://www.google.com/#hl=en&q=michael+jackson",1)
MsgBox, % val


Returns nothing. Is there a reason why the URL encoding/decoding script found on the forum is not used?
Back to top
wedu
Guest





PostPosted: Sat Aug 29, 2009 7:23 pm    Post subject: Reply with quote

Forgot to say - thanks for the quick reply!
Back to top
Voltron43



Joined: 27 Mar 2009
Posts: 76
Location: Dublin, IE

PostPosted: Sat Aug 29, 2009 7:35 pm    Post subject: Reply with quote

wadu wrote:
The moment the url contains # or & the query starts to fall and in some cases, throws the authentication problem maybe due to the 'encoding' scheme.

Try add a number sign '#' to line 158 of bitlyAPI.ahk

Code:
ascii=?&+=# ; strings to convert to hex

Thanks for the catch. Wink
_________________
My Scripts
Back to top
View user's profile Send private message Visit poster's website
wedu
Guest





PostPosted: Sat Aug 29, 2009 7:59 pm    Post subject: thanks! Reply with quote

Cool - thanks! That fixed it. Would it be possible to add a leading http:// in case it's missing?
For example if I type just google.com (instead of http://google.com) I get a blank answer.

Cheers
Back to top
Voltron43



Joined: 27 Mar 2009
Posts: 76
Location: Dublin, IE

PostPosted: Sat Aug 29, 2009 8:08 pm    Post subject: Re: thanks! Reply with quote

wedu wrote:
...Would it be possible to add a leading http:// in case it's missing?
For example if I type just google.com (instead of http://google.com) I get a blank answer.

Let me look into it.
_________________
My Scripts
Back to top
View user's profile Send private message Visit poster's website
wedu
Guest





PostPosted: Wed Sep 02, 2009 4:54 pm    Post subject: Reply with quote

Any update?

Thanks
Back to top
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Wed Sep 02, 2009 6:20 pm    Post subject: Reply with quote

@wedu: it is so easy to add you can probably do it yourself.
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
wedu
Guest





PostPosted: Wed Sep 09, 2009 11:24 am    Post subject: Reply with quote

I'll try to hack the script myself but if the improvement would make its way to the original script, then all the other downloaders would benefit from it.
Back to top
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Wed Sep 09, 2009 11:29 am    Post subject: Reply with quote

Simply post your solution, e.g. replace these lines with this...
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Sun Sep 20, 2009 11:16 am    Post subject: Reply with quote

LongURL

Quote:
Avoid phishing, malware, and viruses by examining short URLs before visiting them. Find out where links really take you.


LongURL provides a simple RESTful API to allow application developers to easily use its service.

Example call: http://api.longurl.org/v2/expand?url=http%3A%2F%2Fis.gd%2Fw

Supports over 200 shortening sites.

Cool
Back to top
Voltron43



Joined: 27 Mar 2009
Posts: 76
Location: Dublin, IE

PostPosted: Tue Sep 22, 2009 9:47 pm    Post subject: Reply with quote

Added j.mp support to To-Do list.
_________________
My Scripts
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sat Feb 12, 2011 9:03 pm    Post subject: Reply with quote

is this still working for anyone?
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group