Posted by kmonty on October 7, 2009 at 4:22pm
| Project: | Service links |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I am not completely sure if I just have not setup the module correctly or it is broken. However, given the short url settings I have (see attached), I would assume that Twitter would be given tinyurls.
I'm curious if this is a bug (my suspicion) or if I have configured the module incorrectly?
If it is a configuration issue, I would encourage you to add some documentation on this, as it is not clear how to enable tinyurls for twitter.
Using the latest 2.x dev release.
| Attachment | Size |
|---|---|
| Screen shot 2009-10-07 at 9.22.04 AM.png | 24.03 KB |
Comments
#1
Still an issue. Just wondering if the maintainers had any thoughts?
#2
This is advertised functionality that does not work so I am marking it as critical.
#3
Here is a simple patch for the service_links_render function that checks to see if we are generating a Twitter link. If we are, it will return the short URL.
I recognize that this isn't the best approach, perhaps a system in which you could check off which services you want to have a tinyurl would be better, but this is a solid interim solution.
#4
I guess it's in general_services.module
If you want to use short links only when requested, you have tou change <encoded-url> to <short-url> in services links
In case for twitter, change this
<?php$links['twitter'] = array(
'name' => 'Twitter',
'description' => t('Share this on Twitter'),
'link' => 'http://twitter.com/home/?status=<encoded-url>+--+<encoded-title>',
);
?>
to
<?php$links['twitter'] = array(
'name' => 'Twitter',
'description' => t('Share this on Twitter'),
'link' => 'http://twitter.com/home/?status=<short-url>+--+<encoded-title>',
);
?>
of course you can apply this for other service to tell the module that the service request short links.
#5
el7cosmos
Thank you. And there's the only way to use "only when requested" option, right?
UPD: It doesn't seem to work. There's still either long names or short names for _all_ bookmarks...
#6
did you set use short links only when requested in service links configuration?
#7
Hi el7cosmos,
I'm trying to figure out how to optimize the two patches provided in the post.
As the end result, I'm trying to use short URLs on Twitter and full URLs on Facebook.
Any suggestions on how to achieve this?
Thanks,
CarbonPig
#8
Here is the patch for short url in twitter and full url in facebook.
#9
change patch name.
#10
#11
el7cosmos
> did you set use short links only when requested in service links configuration?
Yes, I did it.
#12
added the short url tag as default in twitter
#13
Automatically closed -- issue fixed for 2 weeks with no activity.