File: tweeper_file

package info (click to toggle)
tweeper 1.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 188 kB
  • sloc: php: 419; sh: 53; makefile: 29
file content (25 lines) | stat: -rwxr-xr-x 423 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env php
<?php

require_once __DIR__ . '/../autoload.php';

use Tweeper\Tweeper;

date_default_timezone_set('UTC');

$usage = "{$argv[0]}: <file> <host>\n";

if ($argc < 3) {
    fwrite(STDERR, $usage);
    exit(1);
}

$file_url = 'file://' . realpath($argv[1]);
$host = $argv[2];

$tweeper = new Tweeper();
$output = $tweeper->tweep($file_url, $host, false);
if (is_null($output)) {
    exit(1);
}
echo $output;