var user_id = Math.floor(Math.random() * (99999999 - 10000000 + 1)) + 10000000; var user_name = req.body.user_name; var user_soname = req.body.user_soname; // soname =) var user_mail = req.body.user_mail; var user_city = req.body.user_city; var user = new User({ _id: user_id, user_name: user_name, user_soname: user_soname, // soname =) user_mail: user_mail, user_city: user_city });
$start_file = "start.txt";
$servers = Array("server1.com", "server2.com", "server3.com", ....);
function opros($start){
$num = $start+1;
for(;$num < count($servers); $num++){
// опрашиваем сервер
}
// перед выходом из функции сохраним номер последнего опрошенного сервера
file_put_contents($start_file, $num);
}
$s = int(file_put_contents($start_file));
opros($s);
def post_img(url):
print('Заупуск функци post_img:', url, '\n')
response = requests.get(url, timeout=10)
parsed_body = html.fromstring(response.text)
text_from_url = parsed_body.xpath('//span[@alt="pic"]/img/@src')
print(text_from_url.html())
post_img('nnmclub.to/forum/viewtopic.php?t=1028529')