Kynetx’s New Sandboxed Browser Extensions

I recently released my “Old School Retweet” Kynetx app in the Kynetx app store for the newly released browser extensions. I super love the new extensions and all that they do for users and developers alike. Something that I forgot when I released the app in the app store is that the new extension are sandboxed.

Because the extensions are sandboxed, all of the scripts from the extensions run a bit differently than they used to in the previous Kynetx extensions. Without getting into the technical details too much, the previous extensions just injected JavaScript into the page and the new extensions run JavaScript in a sandbox which has access to the DOM but can’t access anything else on the page. Because of this change my retweet app broke since I was using the jQuery loaded by Twitter.com to bring up the new tweet box (I do this because Twitter.com used that library to bind a click event and to trigger that event it has to be from the same library that bound it). Thankfully, with the help of a friend, I was able to get a work around for both Firefox and Chrome’s sandbox environment.

How I did it…

If the app is run not inside a sandbox I can just access the jQuery that Twitter.com loads to open a new tweet box

$("#new-tweet").trigger("click");

From within the Firefox sandbox I can access the page outside of the sandbox

window['$']("#new-tweet").trigger("click");

If I am in the Chrome sandbox I can create a script element that has the JavaScript that I want to execute. Crude, but it works. : )

var trigger_click_script = document.createElement("script");
var fallback = "window['$']('#new-tweet').trigger('click');";
trigger_click_script.innerHTML = fallback;
document.getElementsByTagName("head")[0].appendChild(trigger_click_script);

Here is the JavaScript code that I ended up with that gets executed when a user clicks on the retweet button.

// get stuff to retweet
var tweet = $K(this).parents(".tweet-content").find(".tweet-text").text();
var name = $K(this).parents(".tweet-content").find(".tweet-screen-name").text();

// build tweet
var retweet = "RT @"+name+" "+tweet;

// open new tweet box
$("#new-tweet").trigger("click");

// hack for FF sandbox
if ($("#tweet-dialog:visible").length === 0) {
  window['$']("#new-tweet").trigger("click");
}

// put tweet in new tweet box
$K(".draggable textarea.twitter-anywhere-tweet-box-editor").val(retweet).focus();
$K("#tweet_dialog a.tweet-button.button.disabled").removeClass("disabled");

// hack for chrome sandbox
if ($("#tweet-dialog:visible").length === 0) {
  var fallback = "window['$']('#new-tweet').trigger('click'); ";
  fallback += "window['$']('.draggable textarea.twitter-anywhere-tweet-box-editor').val('"+retweet+"').focus(); ";
  fallback += "window['$']('#tweet_dialog a.tweet-button.button.disabled').removeClass('disabled'); ";
  var trigger_click_script = document.createElement("script");
  trigger_click_script.innerHTML = fallback;
  document.getElementsByTagName("head")[0].appendChild(trigger_click_script);
}

Lanyrd.com Catches Up With @MikeGrace

I saw today that Lanyrd.com has released a chrome and firefox extension to filter out tweets on Twitter.com about #SXSW.

I like the design they went with for the UI and it feels good to see a company like Lanyrd create an app that works similarly to what I built about 2 months ago. I decided to put my app interface in the side tray to allow for more controls. The app allows you to hide any tweet based on any word found in the tweet. It also allows you to highlight the tweet if you are interested in particular key words and it remembers your list each time you load the browser.

If you don’t have it, (you really should) you can get it and try it out at http://geek.michaelgrace.org/2011/01/tweet-filter-kynetx-app/

Milestone Celebration For Filtering Foul Language On Twitter

Party!!!!

My party stance

The Kynetx app that I built to filter out foul language on Twitter.com has filtered through over 200,000 tweets removing over 4,300 foul words!

When I originally built the app I didn’t think it would get used by enough people to get through that many tweets so quickly! I’m glad I was able to build this app and that others have enjoyed using it. If you would like to try it out you can get it at http://geek.michaelgrace.org/2011/01/foul-fowl-control-kynetx-app-for-twitter-com/

The Kynetx App I really Want To Build

I wrote the other day on Twitter, “If @my6sense, http://tweetstats.com, @Twitter, and @socialtoo had a baby, that’s the Kynetx app I want to write. #FillANeed”

I’m going to tell you all about what that app looks like and what it does but first some background. I use Twitter a lot.

I have really enjoyed the whole experience. I have found over the past 2 years that connecting with people is what makes Twitter great for me.

Tweeting lots every day is easy along with following lots of people. These two actions only require a little typing and clicking buttons. The hard part is following people and listening to them and engaging in meaningful conversation. I read most updates of the 900 something people that I follow and it takes lots of time and effort.

Here are my goals with Twitter:

  • Find more interesting people to follow and build meaningful relationships with them
  • Spend less time reading tweets that I’m not interested in that have no relevance or are basically spam
  • Spend more time engaged in tweets that are relevant, will help me grow as a person, and build meaningful relationships
  • Help my friends do the same things listed above

Here are some things that stand in the way of me accomplishing those goals

  • Don’t have a way to quantify and report the relevance of a “follow”
  • Don’t have a way to quantify the time spent time on Twitter and different Twitter activities
  • Don’t have a way to quantify the amount of load a particular follow puts on my  Twitter stream

I want to find more people to connect with but it’s a double edged sword. If I follow more people I increase my chances of finding interesting people to connect with but this same action causes more content to come through my Twitter stream. This makes it harder to stay connected with the people that I have already established a meaningful connection with.

I think an app/service can be created to help me reach all my goals and take care of all the road blocks. This is where My6Sense, TweetStats, SocialToo, Twitter, and Kynetx come in. I envision creating a Kynetx app that

  • records how much time is spent on Twitter reading tweets
  • what percentage of the tweets I read  are from each follow
  • the relevance of Tweets and follows as I read and give feedback

Because a Kynetx app can be deployed as a browser extension it is fairly easy to get this kind of data and report it to a system through a simple API. The server could then take this data and start doing interesting and helpful things with the data. Things like

  • make suggestions to un-follow people based on a ratio of load vs quality content created much like SocialToo attempts to do through rules
  • build cool looking, informative, and geeky charts like TweetStats
  • help me sort Twitter stream based on context similar to what My6Sense does
  • suggest people to follow based on the relevance data received from my friends

Just imagine being able to see personal trends of how much time you spend going through your tweet stream. You could also see trends of the percentage of relevant people you are following, who is generating the most load on your stream, who you find the most relevant, and more. Because all of this is based on your actions on Twitter.com and is quantified you could set goals to improve in different areas. Rewards for achieving those goals could be given and the app could give me help along the way. Built correctly and used well, it could be a powerful tool to transform any social network into an astoundingly strong group of friends and acquaintances that are relevant, meaningful, and create much more benefit than cost to build and maintain.

If you like this idea, have suggestions, or have something you want to say, let me know in the comments or tweet me!

There is lots more that I could write about but I think I’ll hold off for now and see what people have to say about this.