Advertisement
Guest User

lastexport.py -> .scrobbler.log

a guest
Sep 5th, 2015
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $lines = file(__DIR__.'/exported_tracks.txt');
  4. $row = null;
  5. $ts = time();
  6.  
  7. $result = "#AUDIOSCROBBLER/1.0
  8. #TZ/UTC
  9. #CLIENT/Rockbox h3xx 1.1\n";
  10.  
  11. foreach ($lines as $line) {
  12.     $ts -= 30;
  13.     $row = explode("\t", $line);
  14.     $result .= trim(implode("\t", [$row[2], $row[3], $row[1], '', 180, 'L', $ts, $row[4]]))."\n";
  15. }
  16.  
  17. file_put_contents(__DIR__.'/.scrobbler.log', $result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement