Creating a Twitter Composer with Changing URLs

I created my own Twitter app in PHP using the Twitter interface as a framework.

I want to create a composer window so that my application can post a tweet (or response). It will need to integrate with bit.ly (and potentially other shortened URLs). Instead of reinventing the wheel, is there something I can use that jQuery preferably uses?

Ideally, that would be ...

  • Have a character counter that counts from 140 and gives a negative number when you go over 140 characters. Ideally, this would refuse to be sent if there are more than 140 characters.
  • Rewrite URLS on-the-fly (Ajax) using bit.ly or other URL abbreviations and reduce your character account accordingly. the importance of using bit.ly will be to use custom URL abbreviations
  • Names of style screens and hashtags on the fly.

I was looking for GitHub and didn't seem to find anything. I also checked twitter-text-js from Twitter, but although this helps with some of what I want to do, the documentation is pointless and overly complex and does not integrate with bit.

There are many social networking apps that have the functionality I'm looking for, but there doesn't seem to be any sample code that is open source and uses PHP / jQuery.

Thanks.

+7
jquery css php twitter url-shortener
source share
1 answer

https://github.com/twitter/twitter-text-js is a Twitter library for processing text counters, detecting URLs / usernames / hashtags, etc. You may find it extremely useful.

edit: twttr.txt.isInvalidTweet and twttr.txt.getTweetLength most likely you want.

Note. URL shortening does not change the length of the tweet. All URLs occupy a constant number of characters in a Twitter message because Twitter passes all URLs through its t.co contractor. In fact, http://bit.ly does not take 13 characters, it requires 22 .

+2
source share

All Articles