We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Twitter 2.0.1 + Tinyurl

Development and Programming

Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Hey just wondering about LG Twitter using tinyurl for creating links for new entries and such. Sometimes it works as expected, sometimes it posts the full url for the post and not a tinyurl’d URL.

What would be the cause of it not working sometimes and sometimes it does? I would prefer it to use tinyurl for every post to twitter, so any suggestions would be greatly appreciated. thanks

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Sorry don’t have an answer for you but was interested in knowing how you are getting LG Twitter to post using the Tiny URL service?

That’s actually why I can’t help you out as I’m not too sure how you are getting it (LG Twitter) to do that in the first place? 😉

Best wishes,

Mark

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Hi Mark,

As far as I know, it does it automatically. Check out our twitter feed, here you can see the tweets posted by LG Twitter, prefaced with “New Post: etc” all have tinyurl URLs. Not sure if this is something the extension is doing or twitter itself.

       
silenz's avatar
silenz
1,648 posts
16 years ago
silenz's avatar silenz

It’s Twitter itself. In fact you can just send tweets that are way longer than 140 chars.

Like Want to find out who is your celebrity soul mate? http://www.andnowforsomethingcompletelydifferent.de/index.php/gadgets/item/who-is-your-celebrity-soul-mate/. That’s 159 characters. Twitter will autocreate a tinyurl and if it’s below 140 characters [ul]afterwards[/ul], will happily accept it.

LG Twitter would not even send it, if it’s longer than 140 in the first place.

I’d suggest modifying it around line 935. Put $status in a temporary variable, replace all URLs longer than - say - 30 chars with a 30-digit dummy string and check if the resulting length is smaller than 140…

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Aha I see what you mean now 😉

Not too sure why that would work sometimes and sometimes not though. I would guess though that whichever is creating the Tiny URLs (either LG Twitter or Twitter itself) that perhaps the Tiny URL service is down at the time of doing the conversion and so the normal URL goes through instead.

I could be wrong though. Perhaps a quick message to Leevi asking would find out for you though.

Best wishes,

Mark

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
It’s Twitter itself. In fact you can just send tweets that are way longer than 140 chars. Like Want to find out who is your celebrity soul mate? http://www.andnowforsomethingcompletelydifferent.de/index.php/gadgets/item/who-is-your-celebrity-soul-mate/. That’s 159 characters. Twitter will autocreate a tinyurl and if it’s below 140 characters [ul]afterwards[/ul], will happily accept it. LG Twitter would not even send it, if it’s longer than 140 in the first place. I’d suggest modifying it around line 935. Put $status in a temporary variable, replace all URLs longer than - say - 30 chars with a 30-digit dummy string and check if the resulting length is smaller than 140…

Aha there’s our answer 😉

Thanks silenz!

Best wishes,

Mark

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
about 16 years ago
Leevi Graham's avatar Leevi Graham

Hey guys,

I just did a bit of work on this and fixed a few issues. URLs are always shortened now and I’ve added bit.ly support.

http://github.com/newism/lg.twitter.ee_addon/tree/master

Cheers

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
about 16 years ago
Leevi Graham's avatar Leevi Graham

Oh if you want to test the bitly integration you’ll need to add your api key and login at the top of the extension (it’s still in dev).

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.