17 lines
496 B
Plaintext
17 lines
496 B
Plaintext
|
#!/usr/bin/env php
|
||
|
<?php
|
||
|
$argc < 2 and die('Usage: file_generator <namespace>' . PHP_EOL);
|
||
|
require_once __DIR__ . '/vendor/autoload.php';
|
||
|
$push = (new ZMQContext)->getSocket(ZMQ::SOCKET_PUSH)->connect('ipc:///tmp/storage_server_sink.ipc');
|
||
|
$faker = Faker\Factory::create();
|
||
|
|
||
|
$id = 1;
|
||
|
while (true) {
|
||
|
$document = file_get_contents("https://twitter.com/{$faker->firstName}");
|
||
|
$push->send($argv[1], ZMQ::MODE_SNDMORE)
|
||
|
->send($id++ . '.html', ZMQ::MODE_SNDMORE)
|
||
|
->send($document);
|
||
|
|
||
|
sleep(2);
|
||
|
}
|