Twit Connect with @anywhere
I wasn’t sure what to make of @anywhere when it was first released a few days ago. If the @anywhere javascript is installed on a website, you can interact with Twitter data without leaving the website. I read the documentation and tried to figure out how it fit-in with my Twitter WordPress plugin, Twit Connect. After attending the presentation at Chirp and talking with a few of the Twitter devs, I’m pretty clear on where the platform is heading and how Twit Connect can continue to provide WordPress blogs with Twitter integration.
The latest version of Twit Connect (version 2.11) allows you to enable @anywhere on your blog and to configure a few of its features. The most important piece, inserting the @anywhere javascript, is done using WordPress’ “safe” method for adding scripts. However, you may have problems if you add other plugins that include @anywhere functionality. @anywhere loads into an iframe and generates global variables; multiple plugins could easily step on each other depending on the functionality that they include.
I’ve enabled the plugin on my blog. You can see the hovercard effect here: @swhitley. The follow button is displayed on my sidebar, and the tweetbox is at the bottom of every comment form. I particularly like the tweetbox since so many people have asked for ways to allow their users to automatically tweet from a post. Most of these changes are simple options on the Twit Connect Setup Page.
Future versions will include hovercards within the comment sections and I’ll look into using the @anywhere authentication process. There are some security implications and that integration can’t be rushed. And yes, I’ll include a url shortener for the tweetbox (saw that one coming).
You are not limited to the functionality that I provide in the plugin. I’m loading the @anywhere javascript for you, but you can also add your own javascript. There are many options provided by the Twitter team, so feel free to use this as a base and customize as needed. I’ll be updating this plugin as more features become available.
data-text=”Twit Connect with @anywhere (Shannon Whitley)”
data-count=”vertical”
>Tweet

Nice work – I like the added functionality. As long as it doesn’t expand tooo far, it should be cool.
yea – this is great – nice job getting it out so quickly
I would like to offer one enhancement suggestion,
the javascript assignment of:
defaultContent: “put default text here”‘;
in twitconnect/twitconnect.php:
function twc_comment_form()
I’d like to have access to this default text in the config screen. I’m specifically looking to only populate this with the shortlink ‘wp.me’… I’m still trying to modify this function to get that to work.
@Ian Barrs – Thanks, I’ll try to keep a handle on it.
@ticktock – Yes, I plan to do that soon. I wanted to get this out quickly because I’m a bit concerned about the conflicts that can come up if multiple @anywhere plugins are used. I will definitely be adding configuration options.
I’m having a hard time getting the login button to show on my site. The above-text is there, but not the button itself.
I’m on WPMU 2.9.2 and BP 1.2.3.
I’m guessing it’s a problem with my theme.
Where can I find the snip of code to hardcode into my sidebar?
Thanks!
ic – multiple @anywhere plugins, I hadn’t even considered that.
btw: here is a hack I made to twitconnect.php:
defaultContent: jQuery(\’link[rel="shortlink"]\’)[0].href’;
i’m no WP or jQuery expert, but this works for me for now. Thanks!
I have WP 2.9.2 with twit connect plugin + read/write OAuth keys from Twitter, everything looks good in the comments section of the blog, the tweet comment box is there at the very bottom, the authentication/authorization seems to work – it sees the name of the custom app, however none of the tweets actually go through? What’s the best way to do a client side debug?
This error is from Chrome:
Unsafe JavaScript attempt to access frame with URL https://api.twitter.com/xd_receiver.html from frame with URL about:blank. Domains, protocols and ports must match.
And this is firefox:
api.twitter.com : potentially vulnerable to CVE-2009-3555
Where did I mess this up?
Great plugin! All you need now is a Twitter Login button with the login form (or a widget), and it will make it perfect!
.@windump – The Twitter team is still having trouble with naked domains vs. “www” subdomains. That might be your problem. If you are on “www…” in your browser then try removing it (or vice-versa).
.@thefalcon2k – Hi – would love to get more details on your suggestion. The Twitter login button is available now.
.@Greg Fielding – Did you enter the username on the Twit Connect page?
.@ticktock – Cool mod. Thanks for sharing.
This is a great plugin, I have seen it work on other sites, and it’s awesome! But it won’t work for my site for some reason… I’m not sure if you have the time to take a look at it, but I put in the consumer key and consumer secret, and when I click the button, it says this “Woah there!
This page is no longer valid. It looks like someone already used the token information you provided. Please return to the site that sent you to this page and try again … it was probably an honest mistake.” If you know how to fix this, please help me.
@Anthony Jaramillo – Thanks, Anthony. I’ve seen that before and I can’t remember exactly what causes it. There are some sites that can’t handle the “http://” in the querystring (some web servers are set to disallow it). You may want to fall back to the default and try it with the remote oauth option.
Great plugin!