Skip to content

Instantly share code, notes, and snippets.

@funkatron
Created September 24, 2010 21:33
Show Gist options
  • Save funkatron/596092 to your computer and use it in GitHub Desktop.
Save funkatron/596092 to your computer and use it in GitHub Desktop.
/**
* Add some custom timeline filters
*
* There are five timeline filter objects:
* - Spaz.TimelineFilters.friends
* - Spaz.TimelineFilters['public']
* - Spaz.TimelineFilters.lists
* - Spaz.TimelineFilters.search
* - Spaz.TimelineFilters.other
*
* "other" is applied to all other timelines.
*
* We can use a filter to delete a timeline entry entirely by returning null
*
*/
Spaz.TimelineFilters.friends.addFilter('noTweetdeck', function(d) {
if (d.source && d.source.indexOf('TweetDeck') !== -1) { // if the source contains "TweetDeck", remove it
sch.debug('Removing '+d.id+' from results (TweetDeck)');
d = null;
}
return d;
});
Spaz.TimelineFilters.friends.addFilter('no4sq', function(d) {
if (d.text && d.text.toLowerCase().indexOf('http://4sq.com') !== -1) { // if a 4sq link is present, remove it
sch.debug('Removing '+d.id+' from results (4sq)');
d = null;
}
return d;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment