The death cron; Morbidly thinking about speaking from the dead Gmail video lands; What if it was a Gear?
Nov 12

OneRiot has entered your Google

Search, Tech with tags: , Add comments

Tobias Peggs told me about the rebranding of Me.dium to OneRiot to show the change in direction from a “social browsing” company to a real-time search solution.

As a little experiment, to coincide with their launch today, I whipped up a little bit of Greasemonkey goodness in the form of OneRiot in your Google.

The premise is simple, and you have probably seen it before. When you do a Google search, this userscript will head over to OneRiot to do the search there. The top result will then pop-in to the results.

I always tend to do something like this when a new search engine comes out. I am not mentally going to switch from using Google, so bring the mountain to Mohamed and plug in the top result to Google itself. This way, if it shows me something truly new (read: not the same as what Google gives me and still useful) then I will maybe pay more attention to it in the future.

Most of the work itself is infrastructure crud to get around loading up jQuery. Oh for a better way to load standard libraries!

// ==UserScript==
// @name          OneRiot in your Google
// @namespace     http://almaer.com/firefox/userscripts/
// @description   Add a riot to your Google
// @include       http://*google.com/search*
// ==/UserScript==
 
(function() {
	// Add jQuery
	var $;
	var query = parseQuery();
	var oneriotURL = 'http://www.oneriot.com/search?q=' + query;
 
	var script = document.createElement('script');
	script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js';
	script.type = 'text/javascript';
	document.getElementsByTagName('head')[0].appendChild(script);
 
	// Check if jQuery's loaded
	function jQueryCheck() {
		if (typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(jQueryCheck, 100); }
		else { $ = unsafeWindow.jQuery; jQueryReady(); }
	}
	jQueryCheck();
 
	// The Real Work
	function jQueryReady() {
		GM_xmlhttpRequest({
		    method: 'GET',
		    url: oneriotURL,
		    onload: function(response) { // Get the first result from OneRiot
				var resulttitle = response.responseText.match(/(\<a class="result_title".*?\<\/a\>)/)[0];
				if (resulttitle) {
					var title = $(resulttitle);
					var url = title.attr('href');
					var text = title[0].textContent;
					var result = '<div id="oneriot" style="padding: 2px;"><a href="http://oneriot.com/" title="Visit oneriot.com"><img src="http://almaer.com/dion/images/oneriot_logo.png" border="0" style="margin-right: 4px;"/></a> <a href="' + url + '" title="View the OneRiot result">' + text + '</a> <a href="' + oneriotURL + '" style="color: #3399FF; padding: 0 8px;" title="See more results for this query on the oneriot.com website">more oneriot results</a></div>';
					$('#ssb').after(result); // Add it to the Google DOM at the top
				}
		    }
		});
	}
 
	// Get the Google query from the query string
	function parseQuery() {
		var result = window.location.search.match(/\&q=(.*?)\&/);
		if (result && result.length > 0) {
			return result[1];
		}
	}
 
})();

OneRiot at Google

OneRiot seems to do well for certain queries. This example does a good job at showing it off. In the Obama search, instead of just getting BarackObama.com, it shows recent news. That is why it is a nice complement to traditional search engines.

Kudos to the OneRiot team on the launch!

11 Responses to “OneRiot has entered your Google”

  1. Luke Eales Says:

    A very timely and useful post! It’s a very smart way of testing out new search engines without really having to use them at all. And you just might be surprised with some relevant, interesting results cropping up.

  2. jaysonayers Says:

    cool. Thanks for putting this together for us. -jayson
    OneRiot

  3. Kimbal Musk Says:

    Thanks Dion. This is an awesome way for people to try OneRiot!

  4. Edwin Khodabakchian Says:

    dion: did you ever had the chance to try the feedly firefox add-on? it does something similar by mashing together information from Google Reader, Twitter and Friendfeed.

  5. Nick Says:

    Dion, here’s an improved parseQuery() function that will enable toolbar searches to work as well, could be optimized but you get the idea.

    // Get the Google query from the query string
    function parseQuery() {
    var result = window.location.search.match(/\&q=(.*?)\&/);
    if (result && result.length > 0) {
    return result[1];
    }
    var result2 = window.location.search.match(/\?q=(.*?)\&/);
    if (result2 && result2.length > 0) {
    return result2[1];
    }
    }

  6. Rico Says:

    thx dion.

  7. Jenniferlauren Says:

    Nifty little tool! Thanks for the article and showing us how it works! If you get more time to play around with OneRiot, we would love to get your thoughts!

    Thanks!
    Jenny
    Jhodges@oneriot.com

  8. 004 Says:

    We offer a range of services for your World of Warcraft character. We are selling World of

    http://www.powerleveling2000.com Warcraft Gold and doing power leveling for you at an unimaginable

    price. Cheap wow gold is on hot sale on all servers, especially on American servers. You can buy

    cheap wow gold and wow power leveling from us, a professional, loyal and reliable wow gold

    exchange corporation and power leveling work group

  9. Alyysa Says:

    Thanks for the great post, I started my career in nursing after finishing a associate degree in nursing from associate degree nursing schools

  10. Ingo Says:

    thank u.

  11. Jhon Says:

    As an unsuspecting user of onriot adware (attached to a firefox addon. But which one?), I would truly love to know how to get their scrolling crap off the bottom of my firefox browser. I couldn’t give a rats ass about 99% of the topics they scroll.

    If big brother is watching us, oneriot is feeding you. If anyone figures out how get this removed, let me know, Instead check http://www.searchulike.com/ for social search

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What are the first four letters in the word British?

Loading...