Jump to content

Eric Peters

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Eric Peters

  1. Why isn't there a @Google Translate this email feature in @Gmail?

  2. Over the weekend I just saw an option at @HomeDepot to pay with @PayPal doesn't that seem weird? Cashier said he hasn't seen anyone use it

  3. I wonder how many calories I'd burn if I restricted myself to this years #WOTRR to ONLY the treadmill (AudioBooks) #AMOL

  4. I just told the Senate to pass the #JOBSAct and fix old laws for startups and investors. Please add your support: http://t.co/0krDp9xz

  5. .@LivingSocial No, I don't want the Brazillian Wax from yesterday, nor do I want $70 to spend at woman's boutique shop #unsubscribed

  6. This post has been reported for attempting to skirt the rules This German Auto Part Website, have nude models next to their Shock Absorber pictures http://t.co/d5JNY5k8 #cantmakethisshitup #NSFW

  7. When was this announced, 10k @AdWords campaigns instead of 25 per acct? https://t.co/P0vCYUnQ

  8. The plural form of interchange is interchanges, don't know why but I really think it should just be "interchange"

  9. Did a double take when I saw this address: Cockeysville, MD 21030, but it's legit http://t.co/IiEfXIFl

  10. Just declared tab bankruptcy in both Firefox AND Chrome at the same time *sigh*

  11. Dear Lazyweb, Is there a way to easily create a calendar meeting from an email in Google Apps/@GMail?

  12. Why can't @gmail read those stupid Outlook ".eml" files?

  13. the first s/ does a search/replace, the \s is the regex character that matches white space characters (tabs/spaces/etc) the + matches one more more times, the second / / is replacing whitespace characters with a space, the g does a recursion on all of the matches, so it effectively all occurrences of multiple whitespace characters will just become one space instead. I have much perl fu, let me know if you have any specific questions. Guess I wasn't quite sure what you were specifically asking for. I still believe the right approach is to store the archive of the "raw" tweets/etc in some sort of data file (TSV, BDB, MySQL, etc) then you gain flexibility of reformatting them later. -Eric EDIT: $_ is a scalar representation of the default input, the @_ is an array of the default inputs Good little article on it is: http://www.wellho.net/mouth/969_Perl-and-.html Generally I like to do stuff like: while(<FILE>) { chomp($_); my $line = $_; if($line =~ /blahblah/) { } } That way I can "save" the input operator in a more friendly named variable....They're also related to $1, $2, $3 for regex matching.
  14. I think it's VERY useful to store tab-separated values That way you can generate random HTML archives at any point later on. *shrug* each to his own
  15. Here's something to store the tweet archive into a simple TSV file, that way you can later change the formatting if you ever need to. #!/usr/bin/perl # echo "168023980798779395" > lastTweet.tsv # touch tweetArchive.tsv use XML::Simple; use Data::Dumper; my $xml = new XML::Simple('SuppressEmpty' => 1); my $tmpFile = "tmpFile$$"; my $lastIdFile = "lastTweet.tsv"; my $archiveFile = "tweetArchive.tsv"; my $lastId = ""; open(FILE, "$lastIdFile") || die "couldn't open $lastIdFile: $!"; while(<FILE>) { $lastId .= $_ } chomp($lastId); close(FILE); my $URL = "http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=brandsanderson&count=200&trim_user=true&since_id=$lastId"; my $curlParams = " -s "; #silent, can add other parameters my $curlCmd = 'curl '.$curlParams.' -o "'.$tmpFile.'" "'.$URL.'"'; #print $curlCmd . "\n"; system($curlCmd); open(ARCHIVE, ">>$archiveFile") || die "couldn't open archive file for appending"; $data = $xml->XMLin($tmpFile); unlink($tmpFile); #print Dumper($data) . "\n"; my %statusHash = %{$data->{status}}; foreach my $id ( keys %statusHash ) { my $unode = $statusHash{$id}; print ARCHIVE join("\t", ($id, ,$unode->{text} ,$unode->{truncated} ,$unode->{favorited} ,$unode->{in_reply_to_status_id} ,$unode->{in_reply_to_user_id} ,$unode->{in_reply_to_screen_name} ,$unode->{retweet_count} ,$unode->{retweet_count} ,$unode->{user}->{name} ,$unode->{created_at} )) . "\n"; $lastId = $id if($id > $lastId); } close(ARCHIVE); # Write out the last status ID open(FILE, ">$lastIdFile") || die "couldn't open last id tracking file: $!"; print FILE $lastId . "\n"; close(FILE);
  16. The fact WA State only gives a 45 day window to renew business licenses, but then conveniently gives another 90days for $25 extra is $!&*#$

×
×
  • Create New...