Home > Bash > Bebiko Junior competition (bebiklub.pl)

Bebiko Junior competition (bebiklub.pl)

Friend of mine participate in competition on bebiklub.pl – just a simple vote system. Unfortunately I can’t see on which place she is, there is no such a functionality, so I need to implement it by myself. As usual I choice php for that:

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$in = curl_exec($ch);

preg_match_all('/data-votes="(.*)" data-name="(.*)" data-id/i', $in, $out);
        echo $out[2][$i].';';
        echo $out[1][$i]."\n";

It will output a list of nicknames and votes in format:
Afterwards that output can be imported to excel and sorted.

Btw. Don’t forget to vote!

Categories: Bash
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: