Deak Phreak
Super Spiffy Admin
Deak Phreak
Posts: 831
Joined: Nov 2009
Javascript / CSS hacks
I will post my various code you can use when browsing sites to help you get what you want faster
Feel free to post requests and I will do what I can. In order to use the javascript code, you must download the firefox addon
greasemonkey and for CSS code, you must download the firefox addon
stylish . This is mainly for my own personal use and for the stylish plugins, I modify the site to fit my preferences. These are up here so you may also use them if you find them useful.
Image Hosting Plugin: greasemonkey
Description: This will show the image directly without all the hoops some of the sites make you go through. If you have a site that needs to be added, then send me a link so I can code it in. Please make sure you have the latest greasemonkey add-on.
Code:
// ==UserScript==
// @name Website Images
// @namespace Home
// @description Show Various Images
// @include *picswan.com*
// @include *pixsor.com*
// @include *bayimg.com*
// @include *seedimage.com*
// @include *pixoloid.com*
// @include *freebunker.com*
// @include *imagefruit.com*
// @include *imagesnake.com*
// @include *dumppix.com*
// @include *phyrefile.com*
// @include *desibbrg.net*
// @include *vippix.com*
// @include *imagenova.net*
// @include *piratepix.org*
// @include *starpix.us*
// @include *imagehyper.com*
// @include *4ufrom.me*
// @include *pictureturn.com*
// ==/UserScript==
function rtrim(stringToTrim, TrimStr) {
var len = stringToTrim.length;
var last_char = stringToTrim.charAt(len - 1);
if(last_char == TrimStr) {
stringToTrim = stringToTrim.substring(0,len - 1);
}
return stringToTrim;
}
var urlpath = document.baseURI;
// take care of any url that has share- in the url
if(urlpath.search("share-") > 0) {
urlarray = urlpath.split('share-');
document.location = rtrim(urlarray[0], '/') + '/image-'+urlarray[1].replace(".html", ".jpg");
}// take care of any url that has share- in the url
else if(urlpath.search("share.php") > 0) {
if(document.getElementById('share_image')) {
document.location = urlpath.replace("share.php", "image.php");
}
} else if(urlpath.search("imagehyper.com") > 0) {
if(document.getElementById('ab')) {
var imgpath = document.getElementById('ab').offsetParent.firstElementChild.src;
document.location = imgpath;
}
} else if(urlpath.search("picswan.com") > 0) {
if(document.getElementById('img_obj')) {
var imgpath = document.getElementById('img_obj').src;
document.location = imgpath;
} else if(document.getElementById('imagecode')) {
document.getElementById('imagecode').style.visibility = '';
}
} else if(urlpath.search("vippix.com") > 0) {
urlarray = urlpath.split('share-');
document.location = rtrim(urlarray[0], '/') + '/image.php?id='+urlarray[1].replace(".html", "");
} else if(urlpath.search("4ufrom.me") > 0) {
urlarray = document.URL.split('file=');
document.location = 'http://4ufrom.me/files/' + urlarray[1];
} else if(urlpath.search("pictureturn.com") > 0) {
if(document.getElementById('looz1oo')) {
var imgpath = document.getElementById('looz1oo').src;
document.location = imgpath;
}
} else if(urlpath.search("imagenova.net") > 0) {
if(document.getElementById('imagen')) {
var imgpath = document.getElementById('imagen').firstChild.href;
document.location = imgpath;
}
} else if(urlpath.search("bayimg.com") > 0) {
if(document.getElementById('mainImage')) {
var imgpath = document.getElementById('mainImage').src;
document.location = imgpath;
}
} else if(urlpath.search("seedimage.com") > 0 || urlpath.search("desibbrg.net") > 0 || urlpath.search("piratepix.org") > 0) {
var imgpath = document.getElementById('img_obj').src;
document.location = imgpath;
} else if(urlpath.substring(0,23) == 'http://www.pixoloid.com' || urlpath.substring(0,19) == 'http://pixoloid.com') {
var imgpath = document.getElementById('page_body').children[1].children[0].src;
document.location = imgpath;
} else if(urlpath.substring(0,30) == 'http://www.freebunker.com/img/' || urlpath.substring(0,26) == 'http://freebunker.com/img/') {
var imgpath = document.getElementById('img_obj').src;
document.location = imgpath;
} else if(urlpath.substring(0,30) == 'http://www.imagefruit.com/img/' || urlpath.substring(0,26) == 'http://imagefruit.com/img/') {
var imgpath = document.getElementById('img_obj').src;
document.location = imgpath;
} else if(urlpath.substring(0,33) == 'http://www.imagesnake.com/img.php' || urlpath.substring(0,29) == 'http://imagesnake.com/img.php') {
var imgpath = document.getElementById('img_obj').src;
document.location = imgpath;
} else if(urlpath.substring(0,22) == 'http://www.dumppix.com' || urlpath.substring(0,18) == 'http://dumppix.com') {
var imgpath = document.getElementById('boring').src;
document.location = imgpath;
} else if(urlpath.substring(0,36) == 'http://www.phyrefile.com/image/view/' || urlpath.substring(0,32) == 'http://phyrefile.com/image/view/') {
var imgpath = document.getElementById('main_content').children[0].children[0].href;
document.location = imgpath;
}
The Pirate Bay Plugin: stylish
Description: This will remove all the extra "fluff" on the site and make the torrent table wider.
Code:
@-moz-document url-prefix(http://thepiratebay.org), url-prefix(https://thepiratebay.org
{
.ads, .ad, #sky-right, #main-content iframe, #foot iframe, .searchfield h1:first-child, #topright, #footer, #open-software, #fbanners, #TPBlogo
{
display: none !important;
}
#main-content
{
margin: 0px !important
}
}
BlackCats-Games Plugin: stylish
Description: This will remove all the extra "fluff" on the site and make the view more focused on viewing the torrents.
Code:
@-moz-document url-prefix(http://www.blackcats-games.net),url-prefix(http://blackcats-games.net)
{
#side_bar_right, #menu_bar, #bannerbgcell
{
display: none !important;
}
#pagescontainer
{
width: 96% !important;
float: none !important;
}
}
Psx-Scene Plugin: stylish
Description: This will remove all the many ads posted all over the place.
Code:
@-moz-document url-prefix(http://psx-scene.com/forums)
{
table.page center, div.page div center, body center td > table:nth-of-type(3), body center td > table:nth-of-type(2)
{
display: none !important;
}
table.page > tbody > tr td[width="160"], table.page > tbody > tr td[width="125"]
{
display: none !important;
}
}
ps3news Plugin: stylish
Description: This will remove all the many ads posted all over the place. and resize the forums to a better looking format.
Code:
@-moz-document url-prefix(http://www.ps3news.com)
{
div#header2 div:first-child, a#bglink, div.news-summary > div[style="width: 100%; margin-top: 8px;"] > table
{
display: none !important;
}
body
{
background: black !important;
}
}
@-moz-document url-prefix(http://www.ps3news.com/forums)
{
body > div:first-child, body > div[style="width: 20%; float: left;"], ins, td.alt1 > div > div[style="display: block; float: left; margin: 4px 5px 5px 1px;"], td.alt2 > div > div[style="display: block; float: left; margin: 4px 5px 5px 1px;"]
{
display: none !important;
}
body > div > div[style="width: 80%; float: right; text-align: left;"]
{
width: 100% !important;
float: none !important;
}
body > div[style="padding-left: 15px; padding-right: 15px;"]
{
padding-left: 0px !important;
padding-right: 0px !important;
}
}