I have Shorten URL module enabled and configured to use bit.ly as the primary shortener. I have confirmed that the module has in fact created a shortened URL for the page in question. But when a service link is clicked, no URL (long or short) is being displayed. If I turn off Always use short links, the full URL is output. If I turn How generate short links to use node/xxx alias, that works as well. It only does NOT work when Use Short URL service is selected. If I disable Shorten URL, it works using the default tinyurl link.

Comments

TheCrow’s picture

Tried it and used latest dev of Shorten URL with TinyURL as backup shortener service and bit.ly as first and seem it swtich to the backup service everytime, maybe bit.ly doesn't work with local websites?

ckng’s picture

For me I can't get any of the shorten options working, all without link.

gittosj’s picture

It is working but takes some juggling. Steps to fix / enable it are:

1) Make sure shorten itself is properly installed and configured by testing at [www.yoursite.com]/shorten
This took me some time and fettling with settings at [www.yoursite.com]/admin/config/services/shorten
2) Clear your cache and enable the settings at [www.yoursite.com]/admin/config/services/service-links
3) It works!

BeaPower’s picture

works for me after clearing cache and enabling http:// and not www.

Simon Georges’s picture

Status: Active » Fixed

Seems to be ok after clearing caches and properly configuring Shorten.

TheCrow’s picture

Component: Miscellaneous » Documentation
Status: Fixed » Closed (fixed)
BenK’s picture

Title: Shorten URL Not Working » Shorten URL not working if bit.ly is primary shortener and "use www instead of http" is selected
Status: Closed (fixed) » Active

Hi everyone,

Actually, I don't think this problem is resolved yet. At its core, the issue is that the following option is enabled by default in the shorten module:

Use "www." instead of "http://"

But if this option is enabled, then Service Links link shortening won't work if you're using bit.ly. It's a somewhat problematic issue because then you need to uncheck that option (which makes the url several characters longer).

Any idea on how to fix? Not sure if this is a Service Links or Shorten module issue.

--Ben

TheCrow’s picture

Project: Service links » Shorten URLs
Version: 7.x-2.1 » 7.x-1.x-dev
IceCreamYou’s picture

Project: Shorten URLs » Service links
Version: 7.x-1.x-dev » 7.x-2.x-dev

I changed the default for the "www. instead of http://" setting to prefer http://.

However, it sounds like this is actually an issue with Service Links expecting a URL that starts with http:// and not accepting URLs that start with www. instead, though from briefly looking through the code it's not immediately obvious to me where that would be. Shorten URLs is just a dumb API that returns links that are correctly formed according to the settings. Now that the default settings should be compatible, I'll leave it up to the Service Links maintainer to decide whether action is still required on the Service Links side or whether this issue can be marked fixed.

TheCrow’s picture

@Benk followed the #3 suggestions?

@IceCream thank you!

BenK’s picture

It looks like the problem is on the Service Links side.... comments in #3 don't solve the issue.

Thanks,
Ben

TheCrow’s picture

Status: Active » Closed (works as designed)

tested it again with www. option on/off and with localhost/external url, seems that bit.ly doesn't work only for local addresses, that's why it switch to tinyurl (my second choice on shorten urls module)... there is nothing to fix at all, unless you have some not working online website i could give a look on.

BenK’s picture

Status: Closed (works as designed) » Active

@The Crow: Thanks for taking a look. I've got a live website (not local) where I'm experiencing the problem. But the website I'm using is in the format of subdomain.foo.com. Maybe the www option can't be used on a subdomain.... meaning it actually has to be "www", not just any subdomain on the site?

Thanks,
Ben

TheCrow’s picture

Tried right now with http://translate.google.com/ and it still works with both www. on and off, i think the question is, your domain is reachable by bit.ly? This seems to be the only reason why bit.ly shouldn't work.

If you use the bitly.com interface to short your link does it works?

IceCreamYou’s picture

bit.ly should work with the www option. The www option affects the URL that Shorten URLs outputs but has nothing to do with bitly itself -- i.e. Shorten URLs gives a full URL like http://example.com to bit.ly and then bit.ly returns a token like aAbBcC, then Shorten URL uses that to construct a URL like either http://bit.ly/aAbBcC or www.bit.ly/aAbBcC. I just checked and both formats resolve correctly.

If your problem is that Shorten URLs is falling back to the secondary service, that means the request to bit.ly is failing. Usually this would be because you have invalid API keys or something similar. However it looks like bit.ly has deprecated the API that Shorten URLs is using without incrementing the API version -- since it's just deprecated and not removed it should still work, but maybe there's a problem there (or maybe bit.ly isn't giving out the old API keys any more?). Feel free to open a new issue against Shorten URLs to upgrade to the new OAuth authentication scheme.

mmaina’s picture

Had the same problem while using Service Links and in fact, the Facebook button wasn't even showing up! But once I cleared all cache, everything is OK now :-)

the url’s picture

Issue summary: View changes

Thanks for this amazing post, its in me to share my favorite shorten a url service is personally use myself!