Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to add or subtract from the list of shortening services?
We would like to add TR.IM to that list.
Thanks
Alan
Comments
Comment #1
IceCreamYou CreditAttribution: IceCreamYou commentedI will add tr.im to the list--however, it will be the "simple" version. This means that you won't be able to save the shortened URLs to a specific tr.im account.
The more intriguing question in my mind is--are you suggesting there be an extensible system whereby another module could implement a hook to add new services to Tweet? That seems like a good idea to me. It doesn't exist now, and it doesn't seem particularly difficult to do, although I probably won't have time to do it until at least the Tuesday after next.
Comment #2
IceCreamYou CreditAttribution: IceCreamYou commentedI've added tr.im to the list; however, I'm observing that it's slower than some other services. Also, it returns the shortened URL plus a line break, which is kind of weird but doesn't actually change what Twitter shows once the Tweet is submitted. There's really not much I can do about that.
I also added a hook to allow anyone to easily specify additional URL abbreviation services: hook_tweet_service($original). See the documentation for details; basically, you just need to return something like
array('service_name' => 'http://api.abbreviation-service.com/?url=')
.These changes are in dev and will be in the next full release as well.