Bug 281764 - bit.ly URL shortening broken login
Summary: bit.ly URL shortening broken login
Status: RESOLVED FIXED
Alias: None
Product: choqok
Classification: Applications
Component: general (show other bugs)
Version: 1.1
Platform: Debian unstable Linux
: NOR minor
Target Milestone: ---
Assignee: Mehrdad Momeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-10 18:48 UTC by Matej Susta
Modified: 2011-11-01 13:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
bit.ly config (23.44 KB, image/png)
2011-10-31 15:30 UTC, Mehrdad Momeny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matej Susta 2011-09-10 18:48:35 UTC
Version:           1.1 (using KDE 4.6.5) 
OS:                Linux

I'm using bit.ly as URL shortening service and recently wanted to connect URL's shortened in choqok to my account by using my bit.ly api login.

The problem is, that the choqok doesn't allow me to input needed characters into the "Bit.ly Login" box. On the info page https://bitly.com/a/your_api_key I've got my login and API key, but when I try to copy&paste or rewrite the login, I can't input the underscore "_". The validation then fails.

Reproducible: Didn't try

Steps to Reproduce:
Try to input your API login&key for the bit.ly service in the settings.

Actual Results:  
You can't input the login name with all necessary symbols.

Expected Results:  
You can input it.

Tested on version 1.1.5+git20110825-1.
Comment 1 Matej Susta 2011-09-10 19:32:49 UTC
I can't exactly program in C/C++, but I think I've found out the responsible line in:
sourcepkg/plugins/shorteners/bit_ly/bit_ly_config.ccp

This seems to be regexp for login:
QRegExp rx( "([a-z0-9]){4,32}", Qt::CaseInsensitive );
And this for API key:
rx.setPattern("([a-z0-9_]){1,40}");

So basicly, isn't the underscore missing in the first line? :)
Comment 2 Matej Susta 2011-09-10 20:38:55 UTC
Seems that there is something more fishy going around - I've changed the regexp, recompiled and even after that I can't input it in configuration!

However, in the process I've found a quick&funny workaround - just edit the .kde/share/config/choqokrc file and fill in this section:
[Bit.ly Shortener]
api_key=
domain=bit.ly
login=

And enjoy!
Comment 3 Mehrdad Momeny 2011-10-26 14:05:23 UTC
Is the underscore in your login name?
Are you sure?
I just tried to create an account with mtux_test name, and it says that:
Your username can contain only letters and numbers. It must be 4-32 characters in length.

And yes, there's an underscore in your API key, and there's no problem on adding it and setting up your account (I just did it!)
Comment 4 Matej Susta 2011-10-31 13:01:09 UTC
Ok, little bit of misunderstanding here. There are actually 4 pieces of login information: login, password, API username and API key.
To use the bit.ly module, you need to enter the API username + key. However, the API username is different than the username. You can get those on the "your_api_key" page on bit.ly.

For example:
username: foobar
API username: o_3ubqglab1
API key: R_blahblahblah
So yes, there is actually underscore in username, which is used for API calls. I tried to use service username (eg. foobar) instead of API username in the input, but this fails validation.
Comment 5 Mehrdad Momeny 2011-10-31 15:30:07 UTC
Created attachment 65075 [details]
bit.ly config

Here is what I see in https://bitly.com/a/your_api_key
I don't what are you talking about :/
Comment 6 Mehrdad Momeny 2011-11-01 11:55:56 UTC
Git commit c6ff03e4ce3d83bd767a5afdbd0deda135d762ae by Mehrdad Momeny.
Committed on 01/11/2011 at 12:47.
Pushed by momeny into branch 'master'.

BUG:281764 bit.ly generated login names have underscore! when you sign up with twitter account.

M  +1    -1    plugins/shorteners/bit_ly/bit_ly_config.cpp

http://commits.kde.org/choqok/c6ff03e4ce3d83bd767a5afdbd0deda135d762ae
Comment 7 Matej Susta 2011-11-01 13:30:21 UTC
So it was because of twitter signup? I didn't see that, sorry.
Anyway - thanks! :)