Difference between revisions of "FilterBubblet"
From Splatspace
(→Open Questions) |
|||
(4 intermediate revisions by one user not shown) | |||
Line 18: | Line 18: | ||
* Is it possible to reliably extract Google search results from the result HTML? | * Is it possible to reliably extract Google search results from the result HTML? | ||
+ | ** Yes, or so it appears. The list of links is always in an ordered list with an element ID of "rso". Individual links appear to all be of class "tl". [[User:Drew|Drew]] 12:40, 8 June 2011 (MDT) | ||
+ | ** Even easier than that. The <a> is always of class "l" so the following code will dump, in order, the list of google search results (assumes use of '''Firebug''' plugin for Firefox). | ||
+ | |||
+ | <pre> | ||
+ | javascript: | ||
+ | var p=document.getElementsByTagName('*'); | ||
+ | function gc() | ||
+ | { | ||
+ | for(i=0;i<p.length;i++){ | ||
+ | if(p[i].className=='l'){ | ||
+ | console.log(p[i].href); | ||
+ | } | ||
+ | }; | ||
+ | }; | ||
+ | gc(); | ||
+ | </pre> | ||
+ | |||
+ | * Now how do I get data out of the browser to the webs? [[User:Drew|Drew]] 14:19, 8 June 2011 (MDT) | ||
+ | ** Ok, so jQuery must be able to do this. 'cause , ya know, AJAX. But how exactly? [[User:Drew|Drew]] 14:35, 8 June 2011 (MDT) | ||
=Random Ideas= | =Random Ideas= |
Latest revision as of 20:35, 8 June 2011
Contents |
Overview
FilterBubblet is:
- a JavaScript bookmarklet that sends Google search results for a term to a web service
- a web service that stores the results in a database
The idea was born of the TED Talk "Filter Bubble" and Jeff's earlier experiment to test the filter bubble theory manually.
Rationale
- determine if the 'filter bubble' exists, and
- analyze the data and make useful observations, like showing people results they didn't see
- open the filter bubble experiment we conducted on the mailing list to a much larger userbase
- potentially thousands of people could install the filterbubblet bookmarklet and send their results
Open Questions
- Is it possible to reliably extract Google search results from the result HTML?
- Yes, or so it appears. The list of links is always in an ordered list with an element ID of "rso". Individual links appear to all be of class "tl". Drew 12:40, 8 June 2011 (MDT)
- Even easier than that. The <a> is always of class "l" so the following code will dump, in order, the list of google search results (assumes use of Firebug plugin for Firefox).
javascript: var p=document.getElementsByTagName('*'); function gc() { for(i=0;i<p.length;i++){ if(p[i].className=='l'){ console.log(p[i].href); } }; }; gc();
- Now how do I get data out of the browser to the webs? Drew 14:19, 8 June 2011 (MDT)
- Ok, so jQuery must be able to do this. 'cause , ya know, AJAX. But how exactly? Drew 14:35, 8 June 2011 (MDT)
Random Ideas
- Geographic coordination
- Web service could use GeoIP to guess user location, associate results with that location
Technical References
- jQuery Bookmarklet Generator
- How to Create a jQuery Bookmarklet
- Numbering Google Search Results with JavaScript bookmark - difficult to read, but bookmarklet does something close to what we want
- Same origin policy Workarounds - we'll need to use one of these techniques to send results to the database
- Using Sinatra with Bundler to Deploy on Heroku - possible web service/database starting point (Heroku is free, and Sinatra is comparitively easy)