User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Request features for a TWW Greasemonkey script Page 1 ... 4 5 6 7 [8], Prev  
Solinari
All American
16957 Posts
user info
edit post

Unbelievable... Apparently that func needs to be defined in stubby.

7/9/2010 11:41:55 PM

Solinari
All American
16957 Posts
user info
edit post

Quote :
"It is separate from the function that initially parses the threads list. ;P"


oh i see now... it was commented out. It took me a while to get my env set up but i'm rockin and hackin now

should have some secret code for only you and me by the end of the weekend hopefully.

pretty simple, but stunning in its usefulness

7/10/2010 12:18:00 AM

Solinari
All American
16957 Posts
user info
edit post

Here I fixed these two functions for you:

// This function basically does the same as parseMessageBoardList() for a list
// of threads within a section. It does a lot more work, though, since there is
// much richer data to start with and an appalling lack of hooks to use it.
function parseThreadsList() {
// Which section are we viewing?
sectionNum = (location.search).match(/section=\d+/)[0].split("=")[1];
GM_setValue("current_section_id", sectionNum);
GM_setValue("current_section", document.title.substr(6));
console.log(GM_getValue("current_section_id"));
$(window).unload(function () {
GM_deleteValue("current_section_id");
GM_deleteValue("current_section");
});

// Again, we identify the TABLE we're interested in and build a new THEAD to
// separate the column headers from the thread rows.
//
// TODO: Replace the header row's TD elements with TH elements.
threadTable = $('table.inbar').attr('id', 'tww_thread_table');

threadTableBody = $('#tww_thread_table > tbody').attr('id', 'tww_thread_table_body');

threadTableHeaderRow = $('#tww_thread_table_body > tr:first-child').attr('id', 'tww_thread_table_header_row');

threadTableHead = document.createElement('thead');
threadTableHead.setAttribute('id', 'tww_thread_table_header');
threadTableBody.before(threadTableHead);

$('#tww_thread_table_header_row').remove().appendTo($('#tww_thread_table_header'));

// And again, we add classes to each of the rows we're actually interested
// in to reflect that they contain thread information.
threadRows = $('#tww_thread_table_body > tr').addClass('tww_thread_row');

threadListing = [];

// Just like with the message boards list, we're going to just break down
// each cell, take what we need, and build on to the document. This run of
// code takes the longest to run.
$('.tww_thread_row').each(function() {
threadRow = $(this);
threadCells = $(this).children();
threadCells.eq(0).addClass('thread_status');
topicLink = threadCells.eq(1).addClass('thread_topic').children('a:first').addClass('thread_link');

threadNum = topicLink.attr("href").split("=");
threadTopic = topicLink.text();
topicLink.parent().parent().attr('id', 'thread_' + threadNum[1]);

threadCells.eq(2).addClass('thread_author');

authorLink = threadCells.eq(2).children('a:first');
userNum = authorLink.attr("href").split("=");
userName = authorLink.text();
authorLink.parent().parent().addClass("thread_by_" + userNum[1]);

threadReplies = threadCells.eq(3).addClass('thread_replies');
threadViews = threadCells.eq(4).addClass('thread_views');
threadCells.eq(5).addClass('thread_last_post').children('a:first').addClass('user_link');

threadListing.push(new ThreadListing(threadNum[1], threadTopic, userNum[1], userNum[1], threadReplies.text(), threadViews.text()));
/*
// Remember topicRegExp? Now, we use it to test for the words we want
// to follow and apply those words as classes to matching threads.
for (var regExp in topicRegexp) {
if (threadTopic.match(topicRegexp[regExp], "i")) {
threadRow.addClass(topicRegexp[regExp]);
}
}*/
});

// See the image handling in parseMessageBoardList() for more.
threadStatusImages = $('.thread_status img');
threadStatusImages.filter("img[src*='new']").each(function() {
$(this).parent().parent().addClass("new_posts");
});

threadStatusImages.filter("img[src*='old']").each(function() {
$(this).parent().parent().addClass("old_posts");
});

return(threadListing);
}



function ThreadListing(threadid, topic, author, authorid, replies, views) {
this.id = threadid;
this.topic = topic;
this.author = author;
this.authorid = authorid;
this.replies = replies;
this.views = views;
}

7/10/2010 9:33:02 AM

ThePeter
TWW CHAMPION
37709 Posts
user info
edit post

okay the "click on the Wolf" to see the blocked users list is fucking cool

7/12/2010 2:40:50 PM

FroshKiller
All American
51878 Posts
user info
edit post

7/12/2010 4:15:05 PM

ThePeter
TWW CHAMPION
37709 Posts
user info
edit post

Highlighting/hovering over a mysterious looking TWW link, ie

message_topic.aspx?topic=327923

shows the title of the thread, similar to alt-text for a picture.

Eliminates the need for following the link in a post that otherwise has no valuable input to the current thread besides the title of the thread. In practice, it eliminates having to click on a link to load a thread and get the joke before closing the loaded thread. Example:

message_topic.aspx?topic=598120#14151718

7/18/2010 3:49:51 PM

Optimum
All American
13716 Posts
user info
edit post

Probably a dumb question, but what the hell... any ideas if this would work with Chrome's built-in Greasemonkey support? I never really used Greasemonkey w/ Firefox.

7/18/2010 6:02:20 PM

FroshKiller
All American
51878 Posts
user info
edit post

ThePeter said:
Quote :
"Highlighting/hovering over a mysterious looking TWW link, ie

message_topic.aspx?topic=327923

shows the title of the thread, similar to alt-text for a picture."


It's a good idea, but again, I'm only working with what's on the page. This idea would require requesting the thread from the server, parsing out just the thread title, and throwing the rest away. It's a pointless hit and a wasteful way to do things.

That said, it's absolutely the kind of thing the Wolf Web should do. You should post your idea on the Wolf Web's Uservoice site: http://thewolfweb.uservoice.com/

Optimum said:
Quote :
"Probably a dumb question, but what the hell... any ideas if this would work with Chrome's built-in Greasemonkey support? I never really used Greasemonkey w/ Firefox."


Not a dumb question! I haven't tested it, but I doubt it would work perfectly as intended, because I use methods unique to Firefox's JavaScript implementation.

7/18/2010 10:13:20 PM

ThePeter
TWW CHAMPION
37709 Posts
user info
edit post

Fuck, I was going to but then I spent all my votes before finding out you need 1 vote to make a suggestion.

7/19/2010 6:10:00 AM

FroshKiller
All American
51878 Posts
user info
edit post

Well, I liked it well enough to use my last vote on it: http://thewolfweb.uservoice.com/forums/41449-feedback-forum-2/suggestions/920837-add-thread-titles-to-thread-links

7/19/2010 7:33:13 AM

FroshKiller
All American
51878 Posts
user info
edit post

I've taken the script down for now.

Because I'm reworking it.

Because there's a new version coming.

It has a new feature.

That feature is a community-driven NSFW tagger.

You gonna love this shit.

7/30/2010 2:09:17 PM

ThePeter
TWW CHAMPION
37709 Posts
user info
edit post

nice

7/30/2010 4:03:29 PM

FroshKiller
All American
51878 Posts
user info
edit post

All right, I don't have any snazzy visuals to show you, but the results look identical to this right now:

NSFW class

I'll tell you what happens behind the scenes.

When the page for a message board loads, the script grabs all the thread IDs on the current page and sends a request to my database asking whether any have been reported NSFW. The server replies asynchronously, so you're not waiting for the response—the page continues loading. Once the script receives a reply, any threads identified NSFW get classed and styled.

If you're viewing a thread, each post has a link that tells my database to record an NSFW vote for that post. These votes are used to determine which threads are NSFW.

I thought I'd have something ready to release today, but I've decided that I want the voting mechanism to report which page of a thread the post is on and what section the thread is in. That will help me keep performance high, and it'll let me warn you when a particular page is NSFW when the thread itself is relatively innocuous.

This infrastructure will have applications beyond NSFW warnings. I hope to do some really cool stuff going forward.

8/2/2010 9:06:26 AM

 Message Boards » Feedback Forum » Request features for a TWW Greasemonkey script Page 1 ... 4 5 6 7 [8], Prev  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.