A while back I was reading an article on Arstechnica about The Pirate Google. The Pirate Google was created as a response to the verdict in the Pirate Bay Trial. The argument was that Google indexes torrents as does the pirate bay – why isn’t anyone prosecuting Google? The Pirate Google works by appending filetype:torrent to the end of your query and does a search using Google Custom Search. Although The Pirate Google is a clever attempt the fact that it doesn’t provide usable results made it less interesting from a technical stand point. Google doesn’t organize or rate the torrents in any useful way, which also provides less legal liability.
Shortly before I heard about the Pirate Google I noticed a growing number of blogger.com blogs that are dedicated to pirated music. The music is generally provided as a link to a file hosted by a download service provider such as rapidshare or megaupload. I thought what if you could easily search for this music. Much like the Pirate Bay the blog entries are date sorted and have comments, both are key features of the Pirate Bay which make it great for finding quality torrents.
I played around with some of Google’s advanced query features and was shocked at how effective the results were. By limiting my searches to the blogspot.com domain and adding the names of several download service providers was enough to create an extremely effective pirate music search engine. You can enter the same search directly into Google like this:
site:blogspot.com +"Metallica" +(Depositfiles | Divshare | Linkbucks | MediaFire | MegaUpload | Rapidshare | SaveFile | Sendspace | Sharebee | zShare)
Using Google’s JavaScript loader and search APIs I put together a one page ajax application named gBeard to facilitate these searches. If you want to take for a spin the URL is http://www.forgeniuses.com/gbeard/. I’ve included a listing of the source code. Because the application is 100% ajax you can see it all by clicking on “View Source” in your browser.
<html>
<head>
<title>gBeard</title>
<style type="text/css">
body, html {
margin: 0px;
padding: 0px;
}
body {
background-image: url(_img/ocean.gif);
background-color: white;
background-repeat: no-repeat;
background-position: top center;
}
body > div {
width: 988px;
margin: 0 auto;
font-size: 13px;
font-family: sans-serif;
background-color: white;
border: 1px solid white;
}
div.header {
background-image: url(_img/gbeard.jpg);
background-repeat: no-repeat;
height: 192px;
}
div.footer {
font-size: 11px;
padding-top: 11px;
height: 36px;
}
div.footer p {
margin-left: 30px;
}
fieldset {
border: 0px;
padding: 162px 0px 0px 0px;
margin: 0px;
text-align: center;
margin-top:
}
label {
font-weight: bold;
}
h1 {
font-size: 16px;
font-weight: normal;
margin: 11px 0 0 0;
}
p {
margin: 0 0 14px 0px;
}
p.theplank {
margin: 14px 0 14px 0px;
text-align: center;
color: maroon;
}
span.url {
color: #008000;
}
h1 a {
color: #2000cc;
}
a {
color: #7777cc;
}
a:visited {
color: #551A8B;
}
div#searchresults p, div#searchresults h1 {
margin-left: 30px;
margin-right: 30px;
}
</style>
</head>
<body>
<div class="header">
<form onsubmit="plunder(this); return false;">
<fieldset>
<label>gBeard</label>
<input name="q" type="text" value="" />
<select name="sites">
<option value="(Depositfiles | Divshare | Linkbucks | MediaFire | MegaUpload | Rapidshare | SaveFile | Sendspace | Sharebee | zShare)">All</option>
<option value="Depositfiles">Depositfiles</option>
<option value="Divshare">Divshare</option>
<option value="Linkbucks">Linkbucks</option>
<option value="MediaFire">MediaFire</option>
<option value="MegaUpload">MegaUpload</option>
<option value="Rapidshare">Rapidshare</option>
<option value="SaveFile">SaveFile</option>
<option value="Sendspace">Sendspace</option>
<option value="Sharebee">Sharebee</option>
<option value="zShare">zShare</option>
</select>
<input type="submit" value="Go" />
</fieldset>
</form>
</div>
<div id="searchresults"></div>
<div class="footer">
<p>gBeard is public domain. Takes what you wants and wants what you takes. All search results provided by Google. All links to content provided by Blogger.</p>
</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
google.load(’search’, ‘1.0′);
var gWebSearch;
var searchresults = document.getElementById("searchresults");
function theplank(msg) {
searchresults.innerHTML = "<p class=’theplank’><em><strong>" + msg + "</em></strong></p>";
}
function OnWebSearch() {
if (!gWebSearch.results || gWebSearch.results.length == 0) {
theplank("Dead men tell no tales.");
}
else {
searchresults.innerHTML = "";
var results = "";
for (var i = 0; i < gWebSearch.results.length; i++) {
var thisResult = gWebSearch.results[i];
results += "<h1><a target=\"_blank\" href=\"" + thisResult.url + "\">" + thisResult.title + "<\/a><\/h1>";
results += "<p>";
results += thisResult.content + "<br \/>";
results += "<span class=\"url\">" + thisResult.url + "<\/span>";
if (thisResult.cacheUrl) {
results += " – <a target=\"_blank\" class=\"cached\" href=\"" + thisResult.cacheUrl + "\">Cached <\/a>";
}
results += "<\/p>";
}
searchresults.innerHTML = results;
}
}
function plunder(query) {
if (query.q.value == "") {
theplank("Swab the deck!");
}
else {
gWebSearch.execute( ’site:blogspot.com +"’ + query.q.value + ‘" +’ + query.sites.value);
}
}
window.onload = function() {
gWebSearch = new GwebSearch();
gWebSearch.setResultSetSize(GSearch.LARGE_RESULTSET);
gWebSearch.setSearchCompleteCallback(null, OnWebSearch);
}
</script>
</body>
</html>