Pirates of the Burning Sea logo
Pirates of the Burning Sea Forums > Discussion Center > General Discussion
Click here to Log In

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2008, 12:32 PM
Join Date: Jan 2008
Server: Rackham
Society: The Royal Navy
Nation: British
Career: Freetrader
 
Default Let's Grease Twitter!

So, about 16 FLS staff have embraced Twitter in posting short updates to what they're doing.

I first used the RSS feeds of each person to make my own little tracker. But then decided I'd just sign up myself too. The only thing this given 'tracker' is missing imo, is that you have to remember what posts you have already read.

Not anymore!

Thanks to the following Greasemonkey script you'll be able to mark what posts you've already read, and that stays stored in a cookie.

With this I'll be taking down the tracker that I didn't really publish. Just join Twitter yourself!


FLS_Misha: http://twitter.com/FLS_Misha
Me myself an I: http://twitter.com/ArmEagle (listing all the FLSers I'm following myself)

Code:
// ==UserScript==
// @name           NewTwitters
// @author         ArmEagle
// @namespace      http://armeagle.nl
// @description    Add a simple way to keep track of what messages you haven't read yet
// @include        http://twitter.com/home/*
// ==/UserScript==

// The background color for a marked post is set about 15 lines below this :    var read_style = "background-color:
// The background color for the 'Mark All Read' 'tab' is set about 6 lines below this.
// Feel free to modify that
try {

// add a link to mark all posts here read.
var li_markread = document.createElement('li');
li_markread.innerHTML = '<a href="javascript:setLastIDcookie(1);" style="background-color: #aa9999;">Mark All Read</a>';
var ul = document.getElementById('tabMenu');
ul.appendChild(li_markread);

// add a script element
var script_element = document.createElement('script');
script_element.setAttribute('type', 'text/javascript');
// start of a multiline string
script_element.innerHTML = ""+<r><![CDATA[
var read_style = "background-color: #cccccc"; 
// get the last ID and store that in a cookie
function setLastIDcookie() {
    setLastIDcookie(false);
}
function setLastIDcookie(doMarkPosts) {
    var id = document.getElementById('timeline').getElementsByTagName('tr')[0].getAttribute('id').substring(7);
    eraseCookie('lastReadID');
    createCookie('lastReadID', id, 365);
    
    if (doMarkPosts) {
        markPosts();
    }
}

// mark all posts read, based on the cookie value
function markPosts() {
    // get the last read cookie ID, if any
    var lastReadID = readCookie('lastReadID');
    if ( lastReadID != null ) {
        // if any, go trough all rows in the timeline table and mark them by the background color
        var timeline_rows = document.getElementById('timeline').getElementsByTagName('tr');
    
        // go from last to first, so we can jump out the moment we find a newer post
        for ( index=timeline_rows.length-1; index >= 0; index-- ) {
            // check the ID. if it's larger than the lastReadID, then break out
            var row = timeline_rows[index];
            if ( row.getAttribute('id').substring(7)*1 > lastReadID*1 ) {
                break;
            }
            row.setAttribute('style', read_style);
        }
    }
}

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = '; expires='+date.toGMTString();
    }
    else var expires = '';
    document.cookie = name+"="+value+expires+'; path=/';
}

function readCookie(name) {
    var nameEQ = name + '=';
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name,'',-1);
}

markPosts();
]]></r>; // end of the multiline string
// add it to the head element
document.getElementsByTagName('head')[0].appendChild(script_element);

} catch (err) {
    alert(err);
}
Edit:
I added an attachment with a screenshot of my Twitter page with the two changes. The top arrow points to a new button. Pressing this marks up to the last twitter post you see (so you can use it on the pages showing older posts too).
The bottom arrow shows the last marked twitter post; a gray background. It's that simple!
Attached Thumbnails
Click image for larger version

Name:	twit.jpg
Views:	68
Size:	31.7 KB
ID:	15988  
__________________
Visit Online PotBS Maps & Server Stats for online worldmaps, latest unrest changes and recent events!

ArmEagle, you never cease to amaze me. <3
-Misha
Reply With Quote
ArmEagle is offline  

Last edited by ArmEagle : 10-08-2008 at 08:37 AM.
  #2  
Old 09-03-2008, 03:23 PM
Misha
Producer

 
Join Date: Jan 2008
 
Default

I'm being dense but
1) I don't use FireFox. (Stuck w/ IE for our CS tools.) Can I still use GreaseMonkey?
2) If so, what exactly do I do after I d/l it?
__________________
-Misha
Reply With Quote
Misha is offline  
  #3  
Old 09-03-2008, 03:37 PM
Daeke
Community Intern Liaison
Call me Scooter!
 
Join Date: Jun 2008
 
Default

Greasemonkey is a Firefox-only plugin, I believe. So, Misha, you're left in the cold. Maybe you should consider switching
Reply With Quote
Daeke is offline  
  #4  
Old 09-03-2008, 03:40 PM
Join Date: Jan 2008
Server: Roberts
Society: The Royal Guard, Reservist Corps
Nation: Great Britain
Career: Retired Captain
 
Default

Quote:
Originally Posted by Misha View Post
1) I don't use FireFox.
Uh oh...

Quote:
(Stuck w/ IE for our CS tools.) Can I still use GreaseMonkey?
BWAHAHAHAHAHAHAHAHAHAHA!!! Nope.



Nah, just kiddin', you can. Here is the link you're looking for: http://www.gm4ie.com/

Don't ban me!!!
__________________
Sir Richard Holcombe
Retired Privateer; living happily in my luxuries, gained on land and sea


“A good skipper avoids the storm he cannot weather, and weathers the storm he cannot avoid.”
Reply With Quote
sailorman_glh is offline  

Last edited by sailorman_glh : 09-03-2008 at 03:42 PM.
  #5  
Old 09-03-2008, 03:41 PM
Join Date: Jan 2008
Server: Rackham
Society: The Royal Navy
Nation: British
Career: Freetrader
 
Default

Oh, hey Misha.

[striketrough]1. No, GreaseMonkey is only an addon for Firefox. It lets you run Javascript code on specific webpages.[/striketrough] (Yes I know this doesn't work, but it should!).
Well I guess I was proven wrong about this . I have no clue whether my code works in GM4IE though. And am currently on Linux, which treats my hardware so much better, so I can't test it myself either.

GreaseMonkey isn't really user friendly though, but if you want to get it working I'll be happy to help anyone on IRC.
__________________
Visit Online PotBS Maps & Server Stats for online worldmaps, latest unrest changes and recent events!

ArmEagle, you never cease to amaze me. <3
-Misha
Reply With Quote
ArmEagle is offline  

Last edited by ArmEagle : 09-03-2008 at 03:44 PM.
  #6  
Old 09-03-2008, 03:44 PM
dpi209
 
dpi209's Avatar

Join Date: Jan 2008
Server: Roberts
Society: DMV Shipyards
Nation: British
 
Default

1) You can't use Greasemonkey on IE, since it's a Firefox addon. However, there's an extension to IE named IE7Pro that provides similar functionality (and more) for IE7 (I hope you're not stuck on IE6).
2) Add the above script to a user defined script for www.twitter.com. There's a link to a video tutorial how to do so on the IE7Pro page.

I don't know whether the script will work, though...
Reply With Quote
dpi209 is offline  
  #7  
Old 09-03-2008, 03:44 PM
Join Date: Jan 2008
Nation: Spanish
 
Default

Quote:
Originally Posted by Misha View Post
I'm being dense but
1) I don't use FireFox.
You lost me here, how can you not use Firefox?
__________________
Quote:
Originally Posted by Laex
Danica, gird your loins and get some fiercely loyal pirahna in your tub quick quick. Maximus is coming...and he wants your ducky
<@[FLS]Danica> YOur sig. Hurts. My. Brain.
Reply With Quote
SPMaximus is offline  
  #8  
Old 09-03-2008, 03:56 PM
Join Date: Jan 2008
Server: Rackham
Society: The Royal Navy
Nation: British
Career: Freetrader
 
Default

Btw, also check my other two GreaseMonkey scripts:
- http://www.burningsea.com/forums/sho...d.php?p=396982 ('improves' the devtracker')
- http://www.burningsea.com/forums/sho...d.php?p=272588 (an easy accessible 'mark all posts read' link for the subforums)
__________________
Visit Online PotBS Maps & Server Stats for online worldmaps, latest unrest changes and recent events!

ArmEagle, you never cease to amaze me. <3
-Misha
Reply With Quote
ArmEagle is offline  
  #9  
Old 09-04-2008, 04:18 AM
Join Date: Jan 2008
Server: Roberts
Society: Beyond The Pale
Nation: British (Calico Jane)
Career: Privateer
 
Default

I'm trying to figure out how you add everyone to your follow list, nice and quick. Care to help?

EDIT: Well the best way seemed to be, to go to Misha's following's and start following those. Hope she wasn't missing anyone and wasn't following any serial killers
__________________
# _#### ()###
#((alico# ||ane
######[_|###
Reply With Quote
moriwenne is offline  

Last edited by moriwenne : 09-04-2008 at 04:24 AM.
  #10  
Old 09-04-2008, 10:48 AM
Join Date: Jan 2008
Server: Rackham
Society: The Royal Navy
Nation: British
Career: Freetrader
 
Default

Some often read acronyms and terms (feel free to send me more):

Akella: The party FLS is going to work with in Russia (RU)
AU: Australia (The Invincible server)
BVT: Build Verification Test
GH: Guitar Hero
RB: Rock Band
OP (fraxl): Other Project (sekrit!)
CA (Misha): Customer Authentication[?]
AC (Rusty): Advertisement Campaign[?]
__________________
Visit Online PotBS Maps & Server Stats for online worldmaps, latest unrest changes and recent events!

ArmEagle, you never cease to amaze me. <3
-Misha
Reply With Quote
ArmEagle is offline  

Last edited by ArmEagle : 09-22-2008 at 08:14 PM.
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 12:06 PM.

Change Style  Change Language 

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Worldwide: us.png cn.png ru.png au.png