This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-01-28 10:41:44

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

I am working on a Userscript to get Misc. back.

You can install it by installing Greasemonkey except if you're using Chrome, and click here.
Source is here (at least if you're using Firefox), thanks to a glitch in Dropbox's shorten link thingy.

Last edited by cocolover76 (2012-01-28 10:43:54)


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#2 2012-01-28 10:54:46

zippynk
Scratcher
Registered: 2011-07-23
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

How will this work?

And according to the script, it's not done yet so I shouldn't install it  smile


https://dl.dropbox.com/u/60598636/trifocal_interlude_soundcloud_button.png

Offline

 

#3 2012-01-28 11:06:21

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

zippynk wrote:

How will this work?

And according to the script, it's not done yet so I shouldn't install it  smile

It will work by adding a forum to "Interests Beyond Scratch" and when you go there it will do 1 of these:
-Iframe in a Misc. forum that's hosted off-site
-Somehow reverse-engineer the Misc. archive
Or something else.


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#4 2012-01-28 11:12:12

zippynk
Scratcher
Registered: 2011-07-23
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

cocolover76 wrote:

zippynk wrote:

How will this work?

And according to the script, it's not done yet so I shouldn't install it  smile

It will work by adding a forum to "Interests Beyond Scratch" and when you go there it will do 1 of these:
-Iframe in a Misc. forum that's hosted off-site
-Somehow reverse-engineer the Misc. archive
Or something else.

I'm not sure how happy the ST would be about that one. Perhaps you should ask first?


https://dl.dropbox.com/u/60598636/trifocal_interlude_soundcloud_button.png

Offline

 

#5 2012-01-28 11:34:40

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

zippynk wrote:

cocolover76 wrote:

zippynk wrote:

How will this work?

And according to the script, it's not done yet so I shouldn't install it  smile

It will work by adding a forum to "Interests Beyond Scratch" and when you go there it will do 1 of these:
-Iframe in a Misc. forum that's hosted off-site
-Somehow reverse-engineer the Misc. archive
Or something else.

I'm not sure how happy the ST would be about that one. Perhaps you should ask first?

By keeping the archive and injecting from a forum off-site.
Also, I am having problems.
Tell me what part of this doesn't work:

Code:

// ==UserScript==
// @name           Get Misc. Back!
// @namespace      cocolover76
// @description    DO NOT INSTALL IN TESTING.
// @include        http://scratch.mit.edu/forums/
// ==/UserScript==
var fourthTBody = document.getElementsByTagName("tbody")[4].innerHTML;
var injectedHtml = '<tr class="inew"><td class="tcl"><div class="intd"><div class="icon inew"><div class="nosize">There are new posts</div></div><div class="tclcon"><h3><a href="http://scratchmiscellaneous.punbb-hosting.com/index.php">Miscellaneous</a></h3>The old Misc. Provided by Coco.</div></div></td><td class="tc2">I dunno.</td><td class="tc3">I dunno.</td><td class="tcr">I dunno.</td></tr>'
fourthTBody = fourthTBody + injectedHtml;

http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#6 2012-01-28 11:52:10

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

You're setting a string value (innerHTML) to another string.

Offline

 

#7 2012-01-28 11:53:41

FreshStudios
Scratcher
Registered: 2011-04-11
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

Sounds cool  smile


http://i43.tinypic.com/24ymnbn.png

Offline

 

#8 2012-01-28 12:53:37

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

LS97 wrote:

You're setting a string value (innerHTML) to another string.

But other people..... oh.


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#9 2012-01-28 12:55:02

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

cocolover76 wrote:

LS97 wrote:

You're setting a string value (innerHTML) to another string.

But other people..... oh.

Ugh it still doesn't work.


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#10 2012-01-28 13:56:47

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

cocolover76 wrote:

zippynk wrote:

cocolover76 wrote:


It will work by adding a forum to "Interests Beyond Scratch" and when you go there it will do 1 of these:
-Iframe in a Misc. forum that's hosted off-site
-Somehow reverse-engineer the Misc. archive
Or something else.

I'm not sure how happy the ST would be about that one. Perhaps you should ask first?

By keeping the archive and injecting from a forum off-site.
Also, I am having problems.
Tell me what part of this doesn't work:

Code:

// ==UserScript==
// @name           Get Misc. Back!
// @namespace      cocolover76
// @description    DO NOT INSTALL IN TESTING.
// @include        http://scratch.mit.edu/forums/
// ==/UserScript==
var fourthTBody = document.getElementsByTagName("tbody")[4].innerHTML;
var injectedHtml = '<tr class="inew"><td class="tcl"><div class="intd"><div class="icon inew"><div class="nosize">There are new posts</div></div><div class="tclcon"><h3><a href="http://scratchmiscellaneous.punbb-hosting.com/index.php">Miscellaneous</a></h3>The old Misc. Provided by Coco.</div></div></td><td class="tc2">I dunno.</td><td class="tc3">I dunno.</td><td class="tcr">I dunno.</td></tr>'
fourthTBody = fourthTBody + injectedHtml;

Code:

// ==UserScript==
// @name           Get Misc. Back!
// @namespace      cocolover76
// @description    DO NOT INSTALL IN TESTING.
// @include        http://scratch.mit.edu/forums/
// ==/UserScript==
var fourthTBody = document.getElementsByTagName("tbody")[4];
var injectedHtml = '<tr class="inew"><td class="tcl"><div class="intd"><div class="icon inew"><div class="nosize">There are new posts</div></div><div class="tclcon"><h3><a href="http://scratchmiscellaneous.punbb-hosting.com/index.php">Miscellaneous</a></h3>The old Misc. Provided by Coco.</div></div></td><td class="tc2">I dunno.</td><td class="tc3">I dunno.</td><td class="tcr">I dunno.</td></tr>'
fourthTBody.innerHTML = fourthTBody.innerHTML + injectedHtml;

wink

JavaScript object-relation gunk is confusing; basically a variable whose value is passed as a primitive string/float/int will set the variable to that value, while setting it to a complex structure, eg objects or arrays will return a reference to the object or array (arrays, of course, are derived from primitive objects with integer-value rather than string-value pairs).

Told ya it was confusing.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#11 2012-01-28 15:03:32

Zeusking19
Scratcher
Registered: 2011-07-10
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

You can still acess misc, but the topics are locked...

http://scratch.mit.edu/forums/viewforum.php?id=46

Still there. See?

Last edited by Zeusking19 (2012-01-28 15:04:36)


http://i49.tinypic.com/2w7e1jm.pnghttp://dragcave.net/image/eFGFz.gifhttp://dragcave.net/image/9hE5q.gif

Offline

 

#12 2012-01-28 16:07:39

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

I don't see how this will help? You wont be able to post in the old misc, if you host a misc forum you will have to get it Scratch site approved, in which case the site will have had to be up and running for several months and the two new forums still allow scope for the more relevant misc topics while cutting out a lot of the random stuff that just clutters up the fora and causes a moderation drain...


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#13 2012-01-28 20:43:28

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

sparks wrote:

I don't see how this will help? You wont be able to post in the old misc, if you host a misc forum you will have to get it Scratch site approved, in which case the site will have had to be up and running for several months and the two new forums still allow scope for the more relevant misc topics while cutting out a lot of the random stuff that just clutters up the fora and causes a moderation drain...

I am making something that has trusty forum that doesn't need Scratch approved because it is in Scratch.


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#14 2012-01-28 21:13:49

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

its a bit of a big task for a userscript. I suppose I like it.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#15 2012-01-29 00:36:06

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

cocolover76 wrote:

I am making something that has trusty forum that doesn't need Scratch approved because it is in Scratch.

That's not true, it isn't in Scratch. It's an injection which injects a 3rd-party script into the users' browser, and since it doesn't come from the Scratch's site, it isn't a Scratch approved site.

You won't be able to make it without authenticating the users. You also will need to make sure users can't spoof as other users. There are many flaws in making this and many flaws in maintaining something like this.

The idea in general is a good one, but when you say it as part of the Scratch site and it doesn't need to be approved, I consider the idea a dark one.

Offline

 

#16 2012-01-29 13:39:46

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

Magnie wrote:

cocolover76 wrote:

I am making something that has trusty forum that doesn't need Scratch approved because it is in Scratch.

That's not true, it isn't in Scratch. It's an injection which injects a 3rd-party script into the users' browser, and since it doesn't come from the Scratch's site, it isn't a Scratch approved site.

You won't be able to make it without authenticating the users. You also will need to make sure users can't spoof as other users. There are many flaws in making this and many flaws in maintaining something like this.

The idea in general is a good one, but when you say it as part of the Scratch site and it doesn't need to be approved, I consider the idea a dark one.

Diff project I was talking about.
Also, ever hear of the "is []'s password on Scratch []?" block in the Block library for Panther?
I could modify it to Javascript.
Then read cookies.
COOKIE!
And then it auth's peeps.

Last edited by cocolover76 (2012-01-29 13:40:42)


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#17 2012-01-29 13:44:08

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: I am working on a Userscript to get Misc. back.

Hardmath123 wrote:

cocolover76 wrote:

zippynk wrote:


I'm not sure how happy the ST would be about that one. Perhaps you should ask first?

By keeping the archive and injecting from a forum off-site.
Also, I am having problems.
Tell me what part of this doesn't work:

Code:

// ==UserScript==
// @name           Get Misc. Back!
// @namespace      cocolover76
// @description    DO NOT INSTALL IN TESTING.
// @include        http://scratch.mit.edu/forums/
// ==/UserScript==
var fourthTBody = document.getElementsByTagName("tbody")[4].innerHTML;
var injectedHtml = '<tr class="inew"><td class="tcl"><div class="intd"><div class="icon inew"><div class="nosize">There are new posts</div></div><div class="tclcon"><h3><a href="http://scratchmiscellaneous.punbb-hosting.com/index.php">Miscellaneous</a></h3>The old Misc. Provided by Coco.</div></div></td><td class="tc2">I dunno.</td><td class="tc3">I dunno.</td><td class="tcr">I dunno.</td></tr>'
fourthTBody = fourthTBody + injectedHtml;

Code:

// ==UserScript==
// @name           Get Misc. Back!
// @namespace      cocolover76
// @description    DO NOT INSTALL IN TESTING.
// @include        http://scratch.mit.edu/forums/
// ==/UserScript==
var fourthTBody = document.getElementsByTagName("tbody")[4];
var injectedHtml = '<tr class="inew"><td class="tcl"><div class="intd"><div class="icon inew"><div class="nosize">There are new posts</div></div><div class="tclcon"><h3><a href="http://scratchmiscellaneous.punbb-hosting.com/index.php">Miscellaneous</a></h3>The old Misc. Provided by Coco.</div></div></td><td class="tc2">I dunno.</td><td class="tc3">I dunno.</td><td class="tcr">I dunno.</td></tr>'
fourthTBody.innerHTML = fourthTBody.innerHTML + injectedHtml;

wink

JavaScript object-relation gunk is confusing; basically a variable whose value is passed as a primitive string/float/int will set the variable to that value, while setting it to a complex structure, eg objects or arrays will return a reference to the object or array (arrays, of course, are derived from primitive objects with integer-value rather than string-value pairs).

Told ya it was confusing.

Still doesn't work.


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#18 2012-01-29 15:07:49

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

cocolover76 wrote:

Magnie wrote:

cocolover76 wrote:

I am making something that has trusty forum that doesn't need Scratch approved because it is in Scratch.

That's not true, it isn't in Scratch. It's an injection which injects a 3rd-party script into the users' browser, and since it doesn't come from the Scratch's site, it isn't a Scratch approved site.

You won't be able to make it without authenticating the users. You also will need to make sure users can't spoof as other users. There are many flaws in making this and many flaws in maintaining something like this.

The idea in general is a good one, but when you say it as part of the Scratch site and it doesn't need to be approved, I consider the idea a dark one.

Diff project I was talking about.
Also, ever hear of the "is []'s password on Scratch []?" block in the Block library for Panther?
I could modify it to Javascript.
Then read cookies.
COOKIE!
And then it auth's peeps.

If that's the block I think it is, then it won't always work.   If it uses the API thing to authenticate passwords, then only passwords with only letters and numbers work.

Last edited by SJRCS_011 (2012-01-29 15:08:18)


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#19 2012-01-29 15:28:56

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

SJRCS_011 wrote:

If that's the block I think it is, then it won't always work.   If it uses the API thing to authenticate passwords, then only passwords with only letters and numbers work.

That's interesting to know... I didn't know that! What about replacing characters%20with%20equivalent%20symbols%63

Cocolover, I think you're taking on a project that isn't going to work here  hmm


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#20 2012-01-29 16:00:34

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

sparks wrote:

SJRCS_011 wrote:

If that's the block I think it is, then it won't always work.   If it uses the API thing to authenticate passwords, then only passwords with only letters and numbers work.

That's interesting to know... I didn't know that! What about replacing characters%20with%20equivalent%20symbols%63

Cocolover, I think you're taking on a project that isn't going to work here  hmm

I think it does work with %xx encoded characters. There's a flaw on Mod Share though that doesn't allow these kinds of passwords. Good thing not many people use symbols!

Offline

 

#21 2012-01-29 17:54:51

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

sparks wrote:

SJRCS_011 wrote:

If that's the block I think it is, then it won't always work.   If it uses the API thing to authenticate passwords, then only passwords with only letters and numbers work.

That's interesting to know... I didn't know that! What about replacing characters%20with%20equivalent%20symbols%63

Cocolover, I think you're taking on a project that isn't going to work here  hmm

Hey! I think it will work. If Cocolover reads cookies from the scratch site (although, it might not read them, considering how cookies work) then it will give him all the info he needs.

@cocolover Try this: since certain features on Scratch are available, why not have the user go to a certain page (say my stuff) and check if the links that go to the features exist, then set a cookie. You just have to read the username in the cookie. A good link to look for (in the scratch forums) is the profile link. It only apears when a user is logged in.


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#22 2012-01-29 18:49:49

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

I don't think you understand how the user authentication works.
This page right here returns 'true' if the specified username and password are correct, and false if they are not.
http://scratch.mit.edu/api/authenticateuser?username=username&password=password

just use a javascript XMLHttpRequest object to get data from that website.

Code:

function authUser(name, pass) {
requestobj = new XMLHttpRequest();
return requestobj.open("GET","http://scratch.mit.edu/api/authenticateuser?username=" + name + "&password=" + pass,true);

}

There's a handy scratch auth function for you.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#23 2012-01-30 06:15:44

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

Or, in PHP:

Code:

 $t1 = ltrim(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $scratchUsername . '&password=' . $scratchPassword));

if($t1 == 'false'){

}
if($t1 == 'true'){

}

Note that the $t1 variable is a string return, not a boolean.

Last edited by sparks (2012-01-30 06:16:47)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#24 2012-01-30 17:55:33

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

It doesn't return true when auth succeeded, it returns the string
"userID:username:blockedStatus"

with blockedStatus being either "blocked" or "unblocked". However, all you'll be able to do is trick users' browsers into showing some other forum when visiting the Scratch forums. One could as well just go to a different URL... :S If that separate site would be scratch approved.


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#25 2012-01-30 18:33:56

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: I am working on a Userscript to get Misc. back.

JSO wrote:

It doesn't return true when auth succeeded, it returns the string
"userID:username:blockedStatus"

with blockedStatus being either "blocked" or "unblocked".

You're right! I don't actually use the script above, I use an "else" rather than an "if true" but was trying to clarify. Thanks for pointing that out. However, I now realise this script (with the else) will allow access to blocked users.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

Board footer