Hi all,
I’ve been trying to import live data from the National Buoy Center and having difficulties as their url is .txt not .xml. Having looked at previous threads I discovered a read file for URL addresses here: Read webpage - Grasshopper however, though this imports the data it does not update after applying a timer.
Does anyone know how to import and update data live from .txt URL addresses? Having also looked at GHowl it appears to favour XML format data? Could there be a way round this?
Live Data Required (Updated roughly every 6 minutes)
http://www.ndbc.noaa.gov/data/realtime2/KYWF1.txt
Any info you guys could provide would be greatly appreciated.
URL Reader.ghx (58.9 KB)
Right-click and “Edit Source…” on the Web component, set bool cache = false;
?

3 Likes
Ah that’s fixed it, thank you very much! Diving into the C# script is not something I have encountered before.
Each time stamped data entry appears as one item in the list. Would you know how to break these down into a series of lists? mm as one list dd as another etc.? At present I can’t see a way of identifying individual figures. Essentially all I am looking to do is select the current water temperature for input into another script.
Again, many thanks for your help, it is very much appreciated!
It’s called “parsing”. Plenty of examples if you search the GH forums. The best way to ask that question is to internalize the data and present a simple example, like this, which contains only the first 100 lines from your example, instead of 10,869 lines in your real data:
parse_data_2018Feb1a.gh (14.8 KB)
1 Like
Perfect, I’ve got it through searching Parsing. Many thanks again!
I found more on the old forum than the new one.
The last time I tried this, it was harder than it should be because GH doesn’t implement “whitespace” as a delimiter, so handling multiple spaces between columns was a pain. Maybe you can help others by posting what you did to parse this data? Cheers.
I’m sure this is a long-winded way of doing it but it does the job.
I just text split with a space then split each tree into further trees. This allowed me to simply select the item (in this case, most recent water temperature) as a singular piece of data.Data Selecting.gh (6.7 KB)
I see. Well, getting the job done is good. It can be done much better though… Just FYI, it’s usually a bad idea to pass data through a text panel, for various reasons.
1 Like
I’ll take a proper look at parsing once I’ve got it all up and running as I’m sure this is just a quick fix… Oh, I’ll make sure to rectify that from on.
Many thanks again!
Ah nice, that does exactly what I was originally after!
I’ve never used flip matrix before - works a treat!
That’s me sorted, thanks!