Could someone create a patch that creates the option to filter out all twitter updates that either start with or have included an @ sign?
And if possible, maybe add an option that adds a "tweply" or "retweet" class name to the div. Would be nice.
Thanks.
Comments
Comment #1
Nimo commentedsubscribing
Comment #2
td540 commentedwhat?
Comment #3
RonStar-1 commentedBecause the twitter module retrieves the status updates via an HTTP GET, all tweets come back as a giant XML array. After it's been converted to an array, each status is cached. I imagine that you could do a compare on the text of the tweet using the usual string-compare functions to filter out whatever you need before the caching occurs. This all takes place in the twitter_fetch_timeline() function in twitter.inc
Comment #4
kylegiveadamn commentedyou could also perform this this using the views module, and adding a filter to check the message starts with/ does not start with/ contain an @ sign. another method is to edit the 'twitter.inc' file like so
function twitter_cache_status($status = array(), $silent = FALSE) {
db_query("DELETE FROM {twitter} WHERE twitter_id = %n", $status['twitter_id']);
if (substr($status['text'],0,1) != "@")
{
drupal_write_record('twitter', $status);
if (!$silent) {
module_invoke_all('twitter_status_update', $status);
}
}
}
this will store all tweets that don't start with the '@' sign.
hope this helps.
Comment #5
sonlinemedia commentedThanks kylegiveadmin - the filter in views was a great idea!
Comment #6
juampynr commentedClosing.