Export to GitHub

tircd - issue #27

Add support for URL shortening service(s)


Posted on Jan 15, 2009 by Grumpy Bear

Twitter's API doesn't automatically shorten URLs in all cases.

tircd should have an option to auto shrink URLs before they are sent to the twitter API.

Comment #1

Posted on Jan 30, 2009 by Quick Giraffe

I was bored, so I implemented something for this. I've only recently picked up Perl though, so it might not be the best way of doing things. (I didn't add any config options, so it just does it by default.)

Also, this is my first FOSS contribution, so I don't know if the diff that I supplied is the right thing to be giving.

Attachments

Comment #2

Posted on Apr 10, 2009 by Grumpy Bear

(No comment was entered for this change.)

Comment #3

Posted on Aug 8, 2009 by Swift Rhino

We should test the length of the msg and not bother to shorten links if the msg length is 140 chr or less.

Changing line 727 to:

if (length($msg) > 140 && eval("require URI::Find;") &&

$heap->{'config'}->{'shorten_urls'}) {

seems sufficient.

Comment #4

Posted on Mar 1, 2010 by Happy Panda

This code appears in the current codebase.

Status: Fixed

Labels:
Type-Enhancement Priority-Low