So you use NexGolf for booking times and registering scores? How would you like to automatically add your tee-times to your calendar? Are you on Twitter and want to tell the world what you scored?
If you scored 2 or more out of 3 to those questions I might have the solution for you.
In Finland, there are 2 main golf apps: the fore mentioned NexGolf and then there is Golf GameBook. Both offer great functionality for the club golfer, but I think there are 2 features that would add a great deal of value too – especially for NexGolf.
- The ability to add your upcoming rounds of golf to your own calendar
- Automatically posting your scores so you can brag to your friends
NexGolf, of course, provides your booking information and scoring history when you are logged in. At this time there is no way to directly retrieve this information and utilize the data but I have found some sort of workaround.
The data pages are returned in a manageable format, so if you can emulate the login, it is possible to manipulate the data into formats that
- Generate a
.icsfile for your upcoming rounds – a format that can be read by calendar apps
- Generate a
.rssfeed file that lists for your most recently recorded rounds of golf
Add event & scorecard links to your desired service and you have Nexgolf events straight into your calendar & your golf scores tweeted automatically!@ulko7t7
How to get your NexGolf token
Update: There is an updated version of this script available that can generate the codes required and give you links to a calendar file, your scores and now your buddies rounds also. Please see Red Lenses Golf for more details.
Perhaps the trickiest part of the whole process is actually getting a token from NexGolf in the first place. Before you start here are the things that you will need to be able to go on to the next step of generating the URLs to create calendar and feed files.
- NexGolf user account
- A web browser
- Developer tools enabled on your web browser
Screenshots are from Windows / Chrome browser, but developer tools are available on Safari & IE too. I would recommend opening the Nexgolf site in a new tab so you can easily get to this page & view the developer tools output at the same time.
Getting your token
- Open your NexGolf login page in a new tab, for example https://pgc.nexgolf.fi/pgc/member/index.html#/
- Enable developer tools. In Chrome for Windows
CTRL+SHIFT+Iwill open this view, Chrome for Mac is
CMD + OPT + I. For other browsers, check out this link.
- Before logging in, select the network tab in developer tools. Type in
apito make life on the next step a bit easier
- Enter your user name and password. If successful return to the developer tab and look for
sessionin the name
- Highlight session and in the tabs to the right select
- Your token should be 32 characters in length. Copy the code, without quotes & save it somewhere for future use
- Make a note too of the abbreviation code of your golf club (3 letters). This is also available in the same preiview view above. It is also the prefix/subdomain of the Nexgolf site you’ve just logged into.
- Close the NexGolf tab/window. Do not log out!
- Use the token code and paste it into the generator below
Test the URLs you want by copying the links and typing them directly into the address bar of your browser.
If you typed the URL into the address bar you should be presented with a file to download. If this is the case, the token has worked and you should be able to add this to your calendar app of choice.
Following the link generated should be present you with an XML formatted page that should just display (depending on your browser).
Depending on the file/link you selected, if they fail you will be presented with an HTML page stating “No bookings” or “No rounds” respectively. This means either the token did not work, or you really don’t have any events or scores recorded.
Add your NexGolf events to your calendar
If you have been through the link generation & testing process then the final step is to add your
.ics link to your calendar. Here is a quick instruction on how to do this with Google calendar.
Tweet your NexGolf scores automatically
rss code allows you to do almost anything with your latest scores posted to NexGolf. In this example, I’ve linked this file with IFTTT to automate the retrieval of the file & subsequent automatic posting to Twitter. You will need
I’m not going to go into the ins and outs of creating an IFTTT account, but if you an account created & it is linked to Twitter then you create a new applet:
- IF (this) > New feed item
.rssURL you have just created
- THEN (that) > Post a tweet
- Your tweet text should be
- Your tweet text should be
- Unique users: 10
- Golf Clubs: 1
- Script polled: 4541 times
- Last update: 2019-08-19T06:55:09Z
This is an unofficial way of accessing your own information. It may break at any time. Plus at this time it is quite difficult :-/
This has only been tested on Google calendars so far, so I would love to get feedback on how this works across devices. The forms above do not work in Internet
Exploder Explorer or Edge.
Your authentication code (session code) is used and passed through a URL on my servers, of which only I have access, and this may present potential security impact if these are attained by other people. However, there is nothing too personal & your user credentials are hashed. See “how-to” sections for more information.
At this point in time, I am unsure of how long the token actually lasts, so this may have to be renewed periodically. At time of writing the token that generated my codes is still active for over a week.