Joined: 3/20/2008
Blog Posts: 4
Subscribers: 0
Comments: 13
Return to blog
Twitter
11/11/2013
Figured I'd write an informal blog post for a change of pace. Been working on getting twitter up and running on the site and so far I just have two issues to tackle. One is pretty much figured out, the second is a bit of an annoyance and there is no trick to get around it.
 
Limiting Tweets
First off while twitter does not have a specific rate limit for tweets, there are application limits and user limits. To avoid potential problems I plan on using a loose rate limit system. This system is also a prototype that may be used on other areas of the site. The overall process is fairly simple.
The advantage of the above method is you'll be able to post up to 5 tweets within a 5 min interval. To give you a better idea of this method I'll give you 2 examples:
 
Example 1
Action: User posts 5 tweets within 1 minute.
Cause: User will have to wait 1 minute to post to twitter again.
 
Example 2
Action: User posts 3 tweets within 1 min and waits 2 minutes.
Cause: User can now post 4 additional tweets.
 
As you can see this is a far better method than requiring a user to wait 1 min between posts and is very cheap to do code wise.
 
SMS Commands
This is the biggest issue right now. Right now twitter has around 50 special commands for tweets as described here: https://support.twitter.com/articles/14020-twitter-for-sms-basic-features
 
The problem with this is I'm now forced to restrict 35 key words from the start of all tweets. The words are shown here:
 

ON
OFF
FOLLOW
UNFOLLOW
LEAVE
STOP
QUIT
END
CANCEL
UNSUBSCRIBE
ARRET
D
M

RETWEET
SET
WHOIS
W
GET
FAV
FAVE
FAVORITE
FAVOURITE
*
STATS
SUGGEST
SUG

S
WTF
HELP
INFO
AIDE
REPORT
REP
BLOCK
BLK
G

Note: Don't worry you'll be able to *hugs* as much as you want! Just no "* "hugs.

This proves to be a big annoyances and according to responses on the dev forum. There's no way around it or are there plans to allow it in the future. I've tried a few hacks and none seem to work.

As a result I'm stuck with having to modify posts. The quickest option would be to just be to remove these words from the start. However, a better option from what I can tell is to simply change tweets in the following way:

WTF people! => WTF-people!
On the way to my friends house! => On-the way to my friends house!

The downside of this is it looks kinda lame having On-the. Sadly there is no other option unless I can find a better character. I may also look into posting a warning if anyone uses a special word at the start of a tweet.

Anyway, let me know your thoughts. I'm hoping to have this done by tonight or sometime tomorrow.

Nyo

Tags: developer blog, twitter
5 view(s)
Comments:
You must login or register to comment.
  • icon
    ~Webmaster
    Sorry, 139 characters. :( Always forget twitter is limited to 140. (Which is the same as the gobi)
    11/14/2013
  • icon
    ~Webmaster
    Looks like we can fix that "-" issue by sneaking a zero with space in. It'll reduce the tweet length to 239, but it'll do the trick.
    11/14/2013
  • icon
    Nyome +1
    Depends on what you mean by prototype. The timing system is fairly simple and I came up with it in a day since I wanted something lightweight and allows multiple postings at once but still would prevent spamming. The twitter code library code took way too long create but that's a whole blog in itself.
    11/13/2013
  • icon
    TheAwsome
    Quick question did you develop the prototype and if so how long did it take? And in what other ways do you plan to apply the prototype? Also I seem to better understand this system you describe from modifying game scripts when I tried to make my own.
    11/13/2013
  • icon
    Nyome +1
    *follow* is fine. You just can't use any of the words above followed by a space. "Follow ", "G ","SUGGEST ". If you do follow*, it's fine as well as *anything.
    11/11/2013
  • icon
    complex +1
    First of all: http://imgur.com/QHCWC0T Second, yes having to put a dash is totally lame. If we can do *hugs* though, why can't we do *follow* ? Would this work out? If so, then all there is to do is put up a page on how to use the twitter feature if we want to start a sentence with the any of the aforementioned words.
    11/11/2013
Achievement!
Document the discovery of a new anime.
#38646;