NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

while(true) {
try {
driver.get(baseUrl);
break;
} catch (Exception e){
if (countError++>=3) throw e;
}
}

Thread.sleep(1500);
// getAllCurrentNewbieBets();
//
// baseUrl = "https://vprognoze.ru/forecast/pro/";
//
// countError=0;
//
// while(true) {
// try {
// driver.get(baseUrl);
// break;
// } catch (Exception e){
// if (countError++>=3) throw e;
// }
// }
//
//
// Thread.sleep(1500);
// getAllCurrentProBets();

// fillUnsettled();

while(true) {
fillBetsFromURLlist();
}

//driver.quit();


private static void fillBetsFromURLlist() throws Exception {

LocalDataBase db = new LocalDataBase();
ArrayList<VprognozeBet> vprognozeList = new ArrayList<>();
TimeZone.setDefault(TimeZone.getTimeZone("GMT+03"));
Date beginTime = Calendar.getInstance(TimeZone.getTimeZone("GMT+0300")).getTime();

String[] unfilledURLS = LocalDataBase.getNonParsedBetsURLs();

for (String u:unfilledURLS) {

System.out.println(u);

try {
driver.get(URLBuilder.getForecastPage(u));
} catch (Exception e) {
System.out.println("timeout exceeded " + u + " " + URLBuilder.getForecastPage(u));
continue;
}

page = driver.getPageSource();

if (Jsoup.parse(page).select("div:contains(К сожалению, данная страница для Вас не доступна, возможно был изменен ее адрес или она была удалена)").size()>0)
{
System.out.println("отсутствует " + u);
//прописать заход на поиск прогнозов конкретного пользователя в рамках betPlacedDate +- 3 дня
try {
System.out.println("ty");
String author = LocalDataBase.getAuthorNameFromUrl(u);
//Date betPlaced
System.out.println("tryauthor");
driver.get(URLBuilder.getPlayerMainPage(author));
System.out.println(URLBuilder.getPlayerMainPage(author));
} catch (Exception e) {
System.out.println("timeout exceeded " + u + " " + URLBuilder.getPlayerMainPage(LocalDataBase.getAuthorNameFromUrl(u)));
continue;
}

page = driver.getPageSource();

if (Jsoup.parse(page).select("div:contains(По данному критерию новости не найдены, либо у вас нет доступа для просмотра этих новостей)").size()>0)
{continue;}

//задание Task - прописать сбор адресов прогнозов с страницы пользователя с критерием +- 3 дня от основного прогноза;
Document doc = Jsoup.parse(page);
Date lastUserPredictionDate;
lastUserPredictionDate = VprCurBetsParser.getDateTimeOfBetPlacing(doc);
System.out.println("lastUserPredictionDate" + " " + lastUserPredictionDate);
//цикл while last v-user-lastprognoz__date date > u.betDatePlaced-3 дня then push ПОКАЗАТЬ_ЕЩЕ"
//проходим по всем v-user-lastprognoz__date
//if Mod (u.betdate placed - oneOfUserBets) < = 3 дня - добавить в лист адресов
//пройти по адресам из листа

//стереть прогноз с адресом u
continue;
}

vprognozeList.addAll(VprCurBetsParser.parseSeparateBet(page,u));
if (vprognozeList.size()==100) {
db.updateVprUserBetsNoMerge(vprognozeList);
vprognozeList.clear();

}

db.updateVprUserBetsNoMerge(vprognozeList);
vprognozeList.clear();

Date endTime = Calendar.getInstance(TimeZone.getTimeZone("GMT+0300")).getTime();

System.out.println("begin " + beginTime);
System.out.println("end " + endTime);

}
}

public static String[] getNonParsedBetsURLs() throws SQLException {
String[] URLS;
ArrayList<String> list=new ArrayList<String>();
LocalDataBase db = new LocalDataBase();
Connection conn = db.getConnection();
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery("WITH cte AS ( " +
"SELECT TOP(2000) betURL,author FROM vprUserBets WHERE betplacedate IS NULL AND author = '' ORDER BY eventdate), " +
"cte2 AS (SELECT betURL,author FROM vprUserBets WHERE author = '192.168.0.20'), " +
"cte3 AS (SELECT * FROM cte UNION ALL SELECT * FROM cte2), " +
"cte4 as (SELECT TOP (2000) * FROM cte3 ORDER BY author DESC) " +
"UPDATE cte4 SET author = '192.168.0.20' OUTPUT inserted.betURL ");
while (rs.next()) {
String url = rs.getString("betURL");
list.add(url);
}

URLS = new String[list.size()];
URLS = list.toArray(URLS);
statement.close();
conn.close();
return URLS;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.