4 ms·
I am trying to set up a Twitter bog for a blog powered by ExpressionEngine. At the moment, the blog titles are formatted by EE's own Markdown - the difference
by kmfrk 16y ago
I am trying to set up a Twitter bog for a blog powered by ExpressionEngine.
At the moment, the blog titles are formatted by EE's own Markdown - the difference between it and Markdown is that em-dashes are made with "--".
I could use a service that retrieves the RSS information about the blog titles and post their formatted versions (with proper curly quotes, dashes, etc.), but I prefer to manage everything myself.
My question is, what is generally the way to write a Twitter bot for a blog that publishes the post title and (shorturl) link similar to what @daringfireball does, and how do I preserve the formatted title text?
Complete Twitter API novice, but I've been trying to get into doing some projects with it, but the available resources haven't helped me much.
Thanks a bunch for offering your help to everyone at HN.
- abraham 16y agoThe basic steps will be: 1) Hook into the post publish action in EE. 2) get the final URL and shorten it. 3) Format the tweet. 4) Post to Twitter. 1) This is EE specific and I know nothing about EE so you are on you own. 2) You can roll your own URL shortener if you want or use one with an API like http://bit.ly http://bit.ly. http://code.google.com/p/bitly-api/wiki/ApiDocumentation http://code.google.com/p/bitly-api/wiki/ApiDocumentation 3) Format the title however you want. Probably by taking the pre-formated title text, running it through EE's Markdown function, and concatenating the shortened URL to the end. 4) Finally a POST request to Twitter to create the status: http://dev.twitter.com/doc/post/statuses/update http://dev.twitter.com/doc/post/statuses/update. For this I recommend finding a OAuth library for EE as rolling your own will take time and likely won't conform the the OAuth specification. Since it will be a single account there is a shortcut to getting access tokens for the account: http://dev.twitter.com/pages/oauth_single_token http://dev.twitter.com/pages/oauth_single_token.