Created
August 8, 2020 15:40
-
-
Save peter279k/7a3e9d6131aff171b031955a1b7be69a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once './vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
$voteUrl = 'https://udn.com/func/vote/?act_code=v855'; | |
$client = new Client(['cookies' => true, | |
'proxy' => ['http://85.173.165.36:46330'], | |
]); | |
$response = $client->request('GET', $voteUrl); | |
echo (string)$response->getBody(); | |
$randomImgUrl = 'https://udn.com/funcap/keyimg'; | |
$randomImg = $client->request('GET', $randomImgUrl); | |
file_put_contents('./keyimg.jpg', (string)$randomImg->getBody()); | |
exec('tesseract ./keyimg.jpg code'); | |
$code = file_get_contents('./code.txt'); | |
preg_match('/(\d+)/', $code, $matched); | |
$code = $matched[0]; | |
$postVoteUrl = 'https://udn.com/funcap/vote/votingJson.jsp'; | |
$json = [ | |
'code' => $code, | |
'choice' => [2], | |
'id' => 'v855', | |
'email' => '', | |
'g_token' => null, | |
]; | |
$headers = [ | |
'User-Agent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', | |
]; | |
$response = $client->request('POST', $postVoteUrl, [ | |
'json' => $json, | |
'headers' => $headers, | |
]); | |
var_dump((string)$response->getBody()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment