I've built my own Twitter app in PHP with the front end using Twitter Bootstrap as the framework.
I want to build a composer window, so that my app can post a tweet (or a reply). It would need to integrate with bit.ly (and potentially other URL shorteners). Rather than reinvent the wheel, is there something I can use that preferably uses jQuery?
Ideally it would...
I've searched GitHub and can't seem to find anything. I've also checked out twitter-text-js from Twitter, but although it helps with some of what I want to do, the documentation is nonsensical and overly complex and it doesn't integrate with bitly.
There are plenty of social media apps that have the functionality I am looking for, but there doesn't seem to be any example code that is open source and uses PHP/jQuery.
Thanks.
https://github.com/twitter/twitter-text-js is Twitter's JavaScript library for handling text counters, detection of URLs/usernames/hashtags, etc. You may find it extremely useful.
edit: twttr.txt.isInvalidTweet
and twttr.txt.getTweetLength
are likely what you want.
A note: URL shortening doesn't change the length of a tweet. All URLs take up a consistent number of characters in a Twitter post, because Twitter passes all URLs through their t.co
shortener. In fact, http://bit.ly
doesn't take up 13 characters, it takes up 22 for this reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With