Forum Posts

53258 posts

11 minutes ago
rumani gupta 1 post

Topic: Script development / Celebrations of Rakhi with Love and Happiness

Wishing and sending love become very easy and simple as our RakhiWorldWide.com always stands by the side of its user. Let’s deliver highly appreciated threads of Rakhi to brother and celebrate this Rakhi festival in most exclusive ways. Just click on the link www.rakhiworldwide.com/rakhi_uk_worldwide.asp and Send Rakhi to UK.

 
5 hours ago
Jason Green 6 posts

Topic: Script development / Firefox 22 Update - Scripts gone?

I was and deleted and then reverted back to version 21. Thank God!! I wont be updating in such a hurry next time. Ty for the reply.
Regards
Jase

 
5 hours ago
Jason Green 6 posts

Topic: Userscripts.org discussion / Mac Browsers compatibale with Userscripts

I use Mozilla FF/Scriptish one one account but do not know what other Browers I can use with Scripts to run another KOC Account. Can anybody help??
Im no PC genius, so having a Windows OS open as well would not suit me unless the instructions were VERY easy to follow. I would just like another Web Broswer I can have open that doesnt conflict with FF on KOC at the same time.
Ty and regards
Jase

 
5 hours ago
withhelds 2 posts

Topic: Script development / Replacing image link with img src tag

Thanks JoeSimmons, your script work perfectly.

The reason is that on print view, I can show 50 posts from this thread on one page.

In the past, the print view is able to show the image, I'm not sure why they change it to a hyperlink.

Nonetheless, thanks for your help once again :)

 
5 hours ago
emnem 22 posts

Topic: Userscripts.org discussion / downtime / slowness

Hagrid, couldn't you have just told me to stop complaining rather than link me to a review for an at-best loosely related add-on that begs any reader looking for updates to that add-on which are obviously not coming to stop complaining about it? Or did you write that review for me? My apologies, but I don't use Greasefire so why not try writing what you mean right here. I also tend to speaking directly in my writing; maybe you should do the same?

Also, my complaints are uh, valid. Every single time I post them, no matter on what page, at least one person who has no relation to the admins tells me to hush up while three more jump on the thread grovelling for mercy from the admins for even appearing to perhaps, sort of, if you read between the lines, maybe "complain" themselves in some earlier response unrelated to mine.

Like the complaint itself was a crime, not the issue the complaint was made about. Complaining is apparently out of vogue these days. Full expression of honest thought goes right out with it but I guess this latest crop of Internet Wonders fails to take that fact into account, or to care that they are voluntarily silencing themselves to appear "nicer".

I make no such apologies, and I find all these responses perplexing. Instead of focusing on how site admins will not fix problems nor respond to threads associated with them, there is a marauding band of misguided do-gooders on this site who want to DEFEND admins for this behavior and reproach those of us (I understand I'm like one of only three people who actually just spits out what we mean on this site) who complain. Completely ridiculous.

And yeah, since I consider you linking me to that review going off on an unrelated tangent on me, I'm going off on one, too. You're welcome.

 
10 hours ago
idiosyncrisia 2 posts

Topic: Ideas and script requests / [Request] Redirect of a forum logo to forum root

Thank you so, so much! Really, I appreciate this, and will tell the other users of the site about it as well.

 
10 hours ago
JoeSimmons 5605 posts

Topic: Userscripts.org discussion / Install link doesn't install

mbr12 wrote:
I installed an older version of Grease and that allowed the install links to show. The scripts install but don't work. They are enabled and it looks like they should work, but don't.

I've only tried a couple of scripts, one by one, and have no other add-ons.

I'm stumped.
Odd. I'd make a new Firefox profile and try that. If that doesn't work, I'm stumped too.
 
10 hours ago
mbr12 4 posts

Topic: Userscripts.org discussion / Install link doesn't install

I installed an older version of Grease and that allowed the install links to show. The scripts install but don't work. They are enabled and it looks like they should work, but don't.
I've only tried a couple of scripts, one by one, and have no other add-ons.
I'm stumped.

 
11 hours ago
Disc 41 posts

Topic: Ideas and script requests / [Request] Re-enable shift-clicking on sites that disable it

Sorry! I meant opensubtitles.org

 
12 hours ago
JoeSimmons 5605 posts

Topic: Script development / Help getting Netflix script to work ...

You could output to a box created on the page. I have a debug function that I can modify for your needs.
Try using log() in place of console.log() and tell me how this goes:

// Created by avg, modified by JoeSimmons
function create(a,b,c) {
	if(a=="text") {return document.createTextNode(b);}
	var ret=document.createElement(a.toLowerCase());
	if(b) for(var prop in b) if(prop.indexOf("on")==0) ret.addEventListener(prop.substring(2),b[prop],false);
		else if(",style,accesskey,id,name,src,href,type,target".indexOf(","+prop.toLowerCase())!=-1) ret.setAttribute(prop.toLowerCase(), b[prop]);
		else ret[prop]=b[prop];
	if(c) for(let i=0,l=c.length; i<l; i++) ret.appendChild(c[i]);
	return ret;
}

function log(s) {
	var d=document.getElementById("logT");

	if(!d) document.body.insertBefore(d=create("textarea", {id:"logT",style:"margin: 0 1% 6px 1%; padding: 5px; position: inline; width: 97%; height: 40%; color: #000000; background: #E6F4FF; border:3px double #0099FF; border-top: 0; z-index:99999; overflow: scroll !important;"}, new Array(create("text", s))), document.body.firstChild);
		else d.innerHTML += s;
}
 
12 hours ago
JoeSimmons 5605 posts

Topic: Script development / Loading image from /large/ instead of medium

If I'm understanding your request correctly, this should work:

var imgs = document.evaluate("//a/img[contains(@src, '.gif')]", document, null, 6, null);

for(var i=0, img; (img=imgs.snapshotItem(i)); i++) img.setAttribute("src", img.getAttribute("src").replace("/medium/", "/large/").replace("/small/", "/large/"));
 
12 hours ago
JoeSimmons 5605 posts

Topic: Script development / I need help with not working script

No idea. I couldn't fix it.

 
12 hours ago
jcg12345 20 posts

Topic: Script development / Help getting Netflix script to work ...

// ==UserScript==
// @name GetFlix Grabber
// @namespace http://arantius.com/misc/greasemonkey/
// @description Grab all the data about your NetFlix ratings
// @grant GM_registerMenuCommand
// @grant GM_xmlhttpRequest
// @include http://www.netflix.com/*
// @include http://dvd.netflix.com/*
// ==/UserScript==

////////////////////////////////////////////////////////////////////////////////

GM_registerMenuCommand('Start GetFlix', startGetFlix);
GM_registerMenuCommand('Stop GetFlix', stopGetFlix);

var button1=document.createElement('button');
button1.setAttribute('style', 'margin: 0.5em 1em; vertical-align: middle;');
button1.appendChild(document.createTextNode('Start'));
button1.addEventListener('click', startGetFlix, true);

var button2=document.createElement('button');
button2.setAttribute('style', 'margin: 0.5em 1em; vertical-align: middle;');
button2.appendChild(document.createTextNode('Stop'));
button2.addEventListener('click', stopGetFlix, true);

var menu=document.createElement('div');
menu.setAttribute('style', 'text-align: center; border: 10px solid #B9090B;');
menu.appendChild(document.createTextNode('GetFlix:'));
menu.appendChild(button1);
menu.appendChild(button2);
document.body.appendChild(menu);

////////////////////////////////////////////////////////////////////////////////

function startGetFlix() {
// init a single-task queue
actionQueue=[ ['getRatingsPage', 1] ];
// and start the queue running!
runQueue();
}

function stopGetFlix() {
// stop the queue runner
clearTimeout(actionTimer);
actionTimer=null;
// and empty out the queue
actionQueue=[];
}

var niceness=50;
var nicefact=0.33;
function getNice() {
var min=niceness-(niceness*nicefact);
var max=niceness+(niceness*nicefact);

// Peek at first action to slow down remote fetches.
var fac=1;
if (actionQueue && actionQueue[0]) {
if ('get'==actionQueue[0][0].substr(0, 3)) fac=75;
}
return ( (Math.random()*(max-min)*fac) + min );
}

var actionTimer=null;
var actionQueue=[];
function runQueue() {
actionTimer=setTimeout(runQueue, getNice());

var action=actionQueue.shift();
if (!action) return;

//console.log('Queue length: '+actionQueue.length+'. Running action '+action[0]+'.');

switch (action[0]) {
case 'getRatingsPage':
getRatingsPage(action[1]);
break;
case 'parseRatings':
parseRatingsPage(action[1], action[2]);
break;
case 'saveRating':
saveRating(action[1]);
break;
}
}

function getRatingsPage(pagenum) {
//The URLs below are for the Netflix DVD only plan in the US
if (pagenum==1) {
var url='http://dvd.netflix.com/MoviesYouveSeen';
} else {
var url='http://dvd.netflix.com/MoviesYouveSeen'+'?pageN..., 10);
}
//console.info('Fetch:', url);
GM_xmlhttpRequest({
'method':'GET',
'url':url,
'onload':function(xhr) {
actionQueue.push(['parseRatings', pagenum, xhr.responseText]);
}
});
}

function parseRatingsPage(num, text) {
var pattern=/You rated/; //Search pattern used to verify you have rated a movie
var ratings=text.split('addlk');
ratings.shift(); // get rid of the HTML before the first one

for (var i=0, rating=null; rating=ratings[i]; i++) {
//Test to make sure movie is rated so you don't get a rating.match exception
if (pattern.test(rating)) {
try {
var detail={
'id':rating.match(/\/([0-9]+)\?trkid/)[1],
'title':rating.match(/"title"><a.*?>(.*?)</)[1],>
'year':rating.match(/"list-titleyear"> \(([0-9]+)\)/)[1],
'genre':rating.match(/"list-genre">(.+?)</)[1],>
'rating':rating.match(/You.*?movie..([1-9+])/)[1]
};
actionQueue.push(['saveRating', detail]);
} catch (e) {
console.log(detail);
console.debug('Couldn\'t parse ratings item '+i+' on page number '+num+' because:');
console.error(e);
console.log(rating);
stopGetFlix();
}
}
}
//Test to see if more ratings pages
if (text.match(/paginationLink-next/)) {
actionQueue.push(['getRatingsPage', num+1]);
}
}

function saveRating(detail) {
var newtitle=detail.title.replace(/,/g,'');
//replace any commas in movie titles as this is being saved as a comma delimited .csv file
console.log(newtitle+",",detail.year+",",detail.genre+",",detail.rating+",");
}

 
12 hours ago
jcg12345 20 posts

Topic: Script development / Help getting Netflix script to work ...

I decided to just change the firebug console limit from 500 to 2500 (via Firefox about:config), and then just output the comma delimited ratings to console.log and then cut/paste into a .csv file. The good news is I've got it all working and have imported my ratings into a spreadsheet. Considering I had never looked at a line of javascript prior to about a week ago (when I started this "little" project) I'm quite pleased!

Since I've made it this far it seems like I should update the script so it will work for others (ie. URL is different if you are only on the DVD plan). There was another Netflix grabber script done (see link below) and he creates a child window and outputs the ratings to it, and then you cut/paste from there. Most people that would want to use this script probably don't have firebug console installed, so seems like I should try and make that enhancement.

http://badsegue.org/archives/2009/07/15/netflix...

Is there a way to output to the firebug console window without using console.log? I want something that can output without putting a newline at the end.

I'll do a follow on post with nothing but the final code in it. Note that I stripped out all the original extra code that was analyzing the actual movies as all I cared about was the ratings.

 
13 hours ago
JoeSimmons 5605 posts

Topic: Script development / How to automatically click on a given link, if it appears on a page

This should do the trick:

var link = document.evaluate("//a[. = 'View Amazon Product Page']", document, null, 9, null).singleNodeValue;

if(link !== null) window.location.href = link.href;

 
14 hours ago
JoeSimmons 5605 posts

Topic: Script development / how to get a document element from ajax module?

ice3366 wrote:
I want to get document element from an ajax asynchronous refresh div module in external web page.This module will be loading after click a button on the page.
Well you could add an event listener to listen for page changes, then check for the div again.
document.addEventListener("DOMSubtreeModified", function(e) {
	document.getElementById("someDIV");
	// do stuff
}
 
14 hours ago
JoeSimmons 5605 posts

Topic: Script development / I love all scripts.

I first learned by just looking at source code. Then I made my own test script and just kept trying things for days, and I would research functions as I needed them. It was only years later when I actually looked up some tutorials. That's probably the backwards way to do it.

I would recommend learning HTML first. It's quite simple so just learn the basics of it. Then research some JavaScript tutorials. Make a test Greasemonkey script and do some simple things.
If you have any problems, you can make a thread here, I'll be happy to answer your questions.
 
14 hours ago
JoeSimmons 5605 posts

Topic: Userscripts.org discussion / 502 Bad Gateway

Oh, didn't see that. Mine is compatible with Opera and Chrome, though. By his compatibility list, his isn't.

 
14 hours ago
JoeSimmons 5605 posts

Topic: Ideas and script requests / Remove http://www.freestockcharts.com/ right side ad banner

If I were you, I'd just install AdBlock so you won't see ANY ads.
But if you wanted to use a script, I'd do this:
var ad = document.getElementById("adFrame");

if(ad !== null) ad.parentNode.removeChild(ad);



Michael Laniak wrote:
the site seems to refresh and bring back the bar
This is interesting. Tell me if the code I gave you works. If the sidebar comes back, I'll add in another method of removing it.
 
15 hours ago
JoeSimmons 5605 posts

Topic: Ideas and script requests / [Request] Redirect of a forum logo to forum root

// ==UserScript==
// @name        PbNation Logo Goes To Forum
// @namespace   http://userscripts.org/users/23652
// @description Make the PbNation logo link go to the forum instead of the homepage
// @include     http://www.pbnation.com/*
// @version     1.0.0
// ==/UserScript==

var link = document.evaluate("//div[@class='hdrLogo']/a[@href]", document, null, 9, null).singleNodeValue;

if(link !== null) {
	link.setAttribute("href", "/forum.php");
}

 
15 hours ago
HAGRID 43 posts

Topic: Userscripts.org discussion / 502 Bad Gateway

I think Martis script is easier on the site. http://userscripts.org/scripts/show/162319 Theres a few others too.

 
15 hours ago
Michael Laniak 1 post

Topic: Ideas and script requests / Remove http://www.freestockcharts.com/ right side ad banner

I am learning to code but would love to see how or if someone could create a script for removing the right side ad banner on this website --> http://www.freestockcharts.com/

Using chrome's "inspect element" I believe this is the code (iframe id="adframe") that brings it up (*at bottom of post). When I edit it, the site seems to refresh and bring back the bar. Any creative ways of removing the ad banner would be tremendously appreciated.

<!-- <iframe id="adFrame" scrolling="no" style="width: 160px; height: 549px; position: absolute; top: 0px; left: 1423px; display: none !important; visibility: hidden !important; opacity: 0 !important; background-position: 0px 0px;" src="/GoogleAd160.aspx?cbust=0.3967230753041804" frameborder="0" marginheight="0" marginwidth="0" width="0" height="0"> </iframe> -->

 
16 hours ago
idiosyncrisia 2 posts

Topic: Ideas and script requests / [Request] Redirect of a forum logo to forum root

Hello,

So a website I frequent is known to just be a forum. It used to be just click the logo at the top of the forum and it takes you back to the root of the forum. Now they have added a homepage that I, and many other users, do not want, and clicking the logo at the top of the forum brings you back to said homepage.

The website is www.pbnation.com and the forums are www.pbnation.com/forums.php

I'd like a way that when the PbNation logo is clicked at the top of the /forums.php no matter what forum you are in at that point, to bring you back to the /forums.php instead of the home page.

How would I go about doing this?

Thank you!

 
18 hours ago
JoeSimmons 5605 posts

Topic: Script development / Help getting Netflix script to work ...

jcg12345 wrote:
The original script has the myBaseURL set to http://backend-goes-here/getflix/. I'm getting errors in the saveRating function. I tried setting myBaseURL file:///C:/Netflix/ hoping I can just write this to a .csv file (to import into a spreadsheet) but it's not creating a file???
Well here's the thing... JavaScript doesn't have the permission to create or write to files; That's why he was outputting into a php backend, then the php puts it into a database because php does have those permissions.

So you need to either find another way to log it into a database/file or get a simple server setup with php+mySql.
 
18 hours ago
jcg12345 20 posts

Topic: Script development / Help getting Netflix script to work ...

OK, yes I finally see how this is working. It's matching the entire string, but it only keeps what is in the inner quotations. I've got all the edits done, now and console.log is correctly outputing id/title/year/genre/rating.

Last step is to get it to output (or worst case I remove all the debug statements to console.log and just send my ratings to console.log). You said you got the original script working, but I'm wondering where was it outputting your ratings to?

The original script has the myBaseURL set to http://backend-goes-here/getflix/. I'm getting errors in the saveRating function. I tried setting myBaseURL file:///C:/Netflix/ hoping I can just write this to a .csv file (to import into a spreadsheet) but it's not creating a file???