Archive for the ‘rubx’ tag
Cheating the world you tweet less
The number of updates on my Twitter page kind of bothers me sometimes. It's a reminder of the amount of time I've spent and wasted on Twitter, it's an ever-itching mole in front of my face. However, I can cheat the system and society and still feel good about myself. What if I just remove all freaking replies I've made, except for those of people I do care about (like my fiance or Ruby Boobie)? And also, I don't want to remove very recent replies.
Well, let's just do it already.
#!/opt/local/bin/perl
use Modern::Perl;
use Net::Twitter;
use DateTime::Format::DateParse;
use DateTime;
binmode STDOUT, ":utf8";
my $t = Net::Twitter->new(
user => shift @ARGV || 'lazy_fuck',
password => shift @ARGV || 'bl0wm3');
my $whitelist = [qw/maggit rubx axiombox/];
my $then = DateTime->now;
$then->subtract(days => 5);
my $x = 1;
for my $i (1..80) {
my $tweets = $t->user_timeline({ page => $i, count => 200 })
or die "No fish for you, loser.\n";
for my $h (@$tweets) {
next unless $h->{"in_reply_to_screen_name"};
next if grep { $_ eq $h->{"in_reply_to_screen_name"} } @$whitelist;
my $date = DateTime::Format::DateParse->parse_datetime($h->{"created_at"});
next unless $date < $then;
say $x, ": (", $h->{"id"}, ") ", $h->{"text"};
$t->destroy_status($h->{"id"});
$x++;
}
}
This little fucker will try to fetch your latest 16'000 tweets (if you have… twat, *grin*, more than that, you've got real issues and I cannot help there, get a shrink or something).
It'll make 80 requests for your timeline (remember Twitter gives you a 100-request hour limit), so only if the reply doesn't come from a certain people AND the reply is older than a given period of time (I'm setting it to one week for me), it'll get rid of it. If a friend doesn't see the reply in a week, she probably never will. After that, it just destroys the tweet (or it tries at least, from my experience, Twitter is still experimenting a hell lot of issues on their service).
That way you can cheat the system removing useless tweets that no one (not even you or the recipient) cares about anymore. Or just… don't give a shit, and you are all set too.
The first time I ran it, I went from like 6k tweets to 2500, which was a nice drop
. If you feel like it, just grab it and customize to fit your needs. You will be needing the CPAN modules Modern::Perl, DateTime, DateTime::Format::DateParse and of course, Net::Twitter.
Rubx: Twitter's Ruby shell
Rubx, also known as Ruby Boobie, is a nice spoiled girlie bot that runs on Twitter. She listens when you talk to her and when you do, it'll better be with Ruby: She will interpret your tweet in Ruby and reply to you with what your code returns.
How does it work? You send a message to her:
@rubx "The day I was born it was a " << Time.local(1984, "aug", 8).strftime("%A")
And @rubx will reply:
@damog "The day I was born it was a Wednesday"
Go see more about her (examples, FAQ, etc) on axiombox.com/rubx or on her Twitter profile.
As we tested the hack, a bunch of people started interacting with Rubx too, some people calling her Twitter Line Interface Ruby Interpreter!
. See what other people has tried with her here.



