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.

Challenges

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.

  1. The ability to add your upcoming rounds of golf to your own calendar
  2. Automatically posting your scores so you can brag to your friends

Solutions

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

  1. Generate a .ics file for your upcoming rounds – a format that can be read by calendar apps
  2. Generate a .rss feed 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

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

  1. Open your NexGolf login page in a new tab, for example https://pgc.nexgolf.fi/pgc/member/index.html#/
  2. Enable developer tools. In Chrome for Windows CTRL+SHIFT+I will open this view, Chrome for Mac is CMD + OPT + I. For other browsers, check out this link.
  3. Before logging in, select the network tab in developer tools. Type in api to make life on the next step a bit easier
#3 – login page with developer tools open & selecting network tab
  1. Enter your user name and password. If successful return to the developer tab and look for session in the name
  2. Highlight session and in the tabs to the right select Preview
#5 – highlighting the session you want to copy the token value
  1. Your token should be 32 characters in length. Copy the code, without quotes & save it somewhere for future use
  2. 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.
  3. Close the NexGolf tab/window. Do not log out!
  4. Use the token code and paste it into the generator below





Calendar (.ics) Link:
Feed (.rss) Link:

Testing

Test the URLs you want by copying the links and typing them directly into the address bar of your browser.

Calendar

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.

RSS

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.

Simply go to your calendar & add the calendar URL (.ics) you have just created!

Tweet your NexGolf scores automatically

The .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

  • The link to the .rss file generated above
  • An IFTTT account
  • A Twitter account

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
    • The .rss URL you have just created
  • THEN (that) > Post a tweet
    • Your tweet text should be {{EntryContent}}

That’s it.

Feedback

I would love to know how you get on. Please let me know by tweeting to me at @ulko7t7. Please use the hashtag #RLgolf.

Current Usage

  • Unique users: 3
  • Golf Clubs: 1
  • Script polled: 938 times
  • Last update: 2019-06-27T13:29:17Z

Disclaimer

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.