Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 12-14-2017, 08:35 PM   #1826
Loki
Currently Loki
 
Loki's Avatar
 
Join Date: Nov 2015
Location: Participating in buffoonery
Posts: 11,881
Re: Programming homework and newbie help thread

It seems like triggers are going to work, and I think I got it mostly figured out. Ignore me, unless someone has some super great tips and tricks for this
Loki is offline   Reply With Quote
Old 12-15-2017, 12:11 AM   #1827
locknopair
journeyman
 
Join Date: Dec 2010
Posts: 382
Re: Programming homework and newbie help thread

Quote:
Originally Posted by ChrisV View Post
locknopair, i will attempt to understand your post at some juncture at which I am not stoned.
thanks man. really hoping you can help.

btw i tried ".hidden" in the selector like you suggested, however the output was oddly all the games from the nfl table, despite connecting my doc with the ncaab table. something is weird about this site, since other tables i am working with (at other sites) have given me zero issue.
locknopair is offline   Reply With Quote
Old 12-15-2017, 12:31 AM   #1828
ChrisV
Carpal \'Tunnel
 
ChrisV's Avatar
 
Join Date: Jul 2004
Location: Adelaide, Australia
Posts: 35,413
Re: Programming homework and newbie help thread

I tried out tr:not(.hidden) in Chrome and it works fine. The problem is that the sports are dynamically shown or hidden by script after the page loads. Pages loaded in a browser can end up looking very different than if you just download the HTML document. This is why using HtmlUnit and injecting script is more flexible. If you don't want to go that route, you'll need to iterate over all the rows and find tr.row-group td.team elements which have NCAAB in the cell text. Then continue to iterate, parsing rows, until you hit another tr.row-group element. No clue how you go about doing that in jsoup.
ChrisV is offline   Reply With Quote
Old 12-15-2017, 12:33 AM   #1829
ChrisV
Carpal \'Tunnel
 
ChrisV's Avatar
 
Join Date: Jul 2004
Location: Adelaide, Australia
Posts: 35,413
Re: Programming homework and newbie help thread

You could also just use HtmlUnit to load the page, wait for all the script stuff to happen, then dump the resulting HTML to jsoup. That would probably be the quickest thing to do as you wouldn't need to change the rest of your code. I'm assuming there that HtmlUnit is capable of dumping DOM documents into HTML. I don't know for certain if it can, I'd be surprised if it can't though.
ChrisV is offline   Reply With Quote
Old 12-15-2017, 12:41 AM   #1830
ChrisV
Carpal \'Tunnel
 
ChrisV's Avatar
 
Join Date: Jul 2004
Location: Adelaide, Australia
Posts: 35,413
Re: Programming homework and newbie help thread

To see the actual document you're giving jsoup, open Chrome devtools (F12) with the sportsinsight page open. Go to Network, up the top, then click Doc in the gray bar below that. Reload the page. Click the "free-odds-frame.aspxblahblahetc" thing. Under Response, after the page loads, you'll see the raw document you get when you request that page.
ChrisV is offline   Reply With Quote
Old 12-15-2017, 12:52 PM   #1831
Lattimer
I are smart
 
Lattimer's Avatar
 
Join Date: Feb 2009
Location: New England
Posts: 11,860
Re: Programming homework and newbie help thread

Quote:
Originally Posted by Loki View Post
It seems like triggers are going to work, and I think I got it mostly figured out. Ignore me, unless someone has some super great tips and tricks for this
I may ping you about this in the next 2 weeks if I run into trouble. I run a playoff fantasy football league on google app engine, and for the past few years I've been manually locking lineups every week sometime on gameday. I'm going to look into having it auto-lock 5 mins before kickoff to reduce my overhead. While it's not quite the same platform as yours it might be done similarly.
Lattimer is offline   Reply With Quote
Old 12-15-2017, 01:17 PM   #1832
Loki
Currently Loki
 
Loki's Avatar
 
Join Date: Nov 2015
Location: Participating in buffoonery
Posts: 11,881
Re: Programming homework and newbie help thread

Yeah, the sheets API looks like it does have something for your purpose. Would appear to be a pretty easy foreach loop, but some of the setup is a little weird.

I saved links in case you have questions.
Loki is offline   Reply With Quote
Old 12-16-2017, 05:39 AM   #1833
locknopair
journeyman
 
Join Date: Dec 2010
Posts: 382
Re: Programming homework and newbie help thread

Quote:
Originally Posted by ChrisV View Post
You could also just use HtmlUnit to load the page, wait for all the script stuff to happen, then dump the resulting HTML to jsoup. That would probably be the quickest thing to do as you wouldn't need to change the rest of your code. I'm assuming there that HtmlUnit is capable of dumping DOM documents into HTML. I don't know for certain if it can, I'd be surprised if it can't though.
hey man it works. although after using htmlunit for a day i can see i've got a lot to teach myself. however i did find some cool stuff that i might use in my program. so thanks again for all the help.

Code:
	    WebClient client = new WebClient(BrowserVersion.CHROME);
	    client.getOptions().setJavaScriptEnabled(true);
	    
	    HtmlPage webPage = client.getPage("https://free.sportsinsights.com/free-odds/free-odds-frame.aspx?MaxColumns=100&LineOption=Spread&SportGroup=sg6");
	    client.close();
	    
	    String webPageToParse = webPage.asXml();
	    Document doc = Jsoup.parse(webPageToParse);
locknopair is offline   Reply With Quote
Old 12-16-2017, 09:58 AM   #1834
ChrisV
Carpal \'Tunnel
 
ChrisV's Avatar
 
Join Date: Jul 2004
Location: Adelaide, Australia
Posts: 35,413
Re: Programming homework and newbie help thread

ChrisV is offline   Reply With Quote
Old 12-23-2017, 12:08 PM   #1835
kerowo
lolcat
 
kerowo's Avatar
 
Join Date: Nov 2005
Posts: 33,931
Re: Programming homework and newbie help thread

Anyone know why awk will start printing a different column than asked for in large csv files?

I'm saying something as simple as awk 'print $71' will have big sections of what is column 72.

Never mind, it's extra commas in an address field in the stupid data.

Last edited by kerowo; 12-23-2017 at 12:18 PM.
kerowo is offline   Reply With Quote
Old 12-28-2017, 02:22 PM   #1836
Loki
Currently Loki
 
Loki's Avatar
 
Join Date: Nov 2015
Location: Participating in buffoonery
Posts: 11,881
Re: Programming homework and newbie help thread

Related to my google apps script question previously, does anyone have any experience using Microsoft Office 365/Sharepoint REST API?

I would love to incorporate some updated data directly from Sharepoint into my sheets doc, and since apps script uses JavaScript I feel like maybe this is possible.

So, say I’m keeping track of a list of documents. I want to update my sheets spreadsheet automatically if the "last edited by" field changes in Sharepoint. Doable?

Just looking into this now, so maybe it’s easy, but at my skill level I highly doubt it.
Loki is offline   Reply With Quote
Old 12-31-2017, 05:34 PM   #1837
aditya
veteran
 
Join Date: Jun 2006
Location: GOAT
Posts: 2,884
Re: Programming homework and newbie help thread

I need a mentor to help/give guidance with using Python Dash/plotly. Willing to pay a reasonable rate. Hesitant to put code on here as it is work related and I figure having a mentor will enable to ask a lot more questions/pick up things a lot quicker. Please PM if interested.
aditya is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 03:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online