skrypt, który pobiera napisy do filmów za pomocą NAPI-PROJEKTU
Kod: Zaznacz cały
#!/bin/bash
cd `dirname $1`
path="Z:"`pwd`"\\"`basename $1`
#echo ${path//\//\\}
wine /home/dawid/.wine/drive_c/Program\ Files/NAPI-PROJEKT/napisy.exe "${path//\//\\}"
skrypt, który parsuje zawartość plików z archiwum gg. nie trzeba podawać numeru, wystarczy nick jaki jest zapisany na liscie kontaktów (należy zmodyfikować ścieżki)
wymagany interpreter php (paczka php5-cli)
Kod: Zaznacz cały
#!/usr/bin/php
<?php
function white($text) {
$text = str_replace('\n', "\n", $text);
$text = str_replace('\r', "\r", $text);
$text = str_replace('\t', "\t", $text);
return $text;
}
foreach (file('/home/dawid/.gg/userlist') as $user) {
list(,,,$uname,,,$unumber) = explode(';', $user);
if ($uname == $_SERVER['argv'][1]) {
//echo $unumber."\n";
break;
}
}
foreach (file('/home/dawid/.gg/archiwum/'.$unumber) as $line) {
if (($x = substr($line,0, strpos($line, ','))) == 'chatsend') {
$x = 1;
} elseif ($x == 'chatrecv') {
$x =2;
} elseif ($x == 'msgrecv') {
$x = 3;
}
$line = substr($line=substr($line=substr($line, strpos($line, ',')+1), strpos($line, ',')+1), strpos($line, ',')+1);
$time = date('Y/m/d H:i', substr($line, 0, strpos($line, ','))); if ($x==1) {
echo $time.' <ja> '.substr($line, strpos($line, ',')+1);
} elseif ($x==2 || $x==3) {
echo $time.' <'.$uname.'> '.white(substr($line=substr($line, strpos($line, ',')+1), strpos($line, ',')+1));
}
}
?>