Skip to content

Instantly share code, notes, and snippets.

@fredrike
Last active June 24, 2016 03:58
Show Gist options
  • Save fredrike/c16f5d5903c2e3e521f5a0a4bf1f4d26 to your computer and use it in GitHub Desktop.
Save fredrike/c16f5d5903c2e3e521f5a0a4bf1f4d26 to your computer and use it in GitHub Desktop.
<?php
$id = "889307941125736_999866820069847";
$file= "889307941125736_2015-10-16T23_889307941125736_999866820069847#1466641440.779.json";
$file= $argv[1];
preg_match("/.*_(.*_.*)#.*/", $file, $output_array);
$id = trim($output_array[1]);
$out = array();
$out[$id] = ['id'=> $id, 'status'=> 'done','exec_time' => 0, 'type'=> 'post'];
$out[$id]['data'] = file_get_contents($file);
print json_encode($out);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment