Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parse a twitter archive csv to pull out the time stamps
<?php
date_default_timezone_set('America/New_York');
$file = $argv[1];
$all = '';
$tweets = '';
$retweets = '';
if (($handle = fopen($file, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
$str = strtotime($data[5])."\n";
$all .= $str;
if ($data[3])
$retweets .= $str;
else
$tweets .= $str;
}
}
echo $tweets;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.