Keywords: Apple Watch, watchOS, Complication, iOS, regex, Numerous
What is it?
I used the App Numerous to show my home measured outside temperature on the iPhone and on the Apple Watch. Therefore my raspberry pi sent the data to the Numerous server, and they did all the work. As you might know the app Numerous is discontinued. As I didn’t find another app which could do the job, I decided to write one.
So how does it work? Simplified you tell the app a website and a filter. Every 1/4 hour the app fetches the site filters it and send the result to the watch. As the filter is a regex the app is very powerful. Unfortunately regex looks a little bit strange if you have never used it before. But the examples in the app should help.
Have a look at an example Open the app and choose “Open List”. Choose the url “http://feeds.feedburner.com/TechCrunch/”. And then push “back” to the main page. With “getURL” you load the site source. This will show after a short while in the text field above. The “Regex” Button will run regex on the source: “<item\>\s*<title>(.*?)</title>”. Let me explain: We load the source of the website and then we want from the source what is like the regex field and between the (). [ >> .<< stands for any character, >>*<< many of them, >>?<< fort the shortest combination]. In other words, it scans the website, looks for the item, title and /title stuff and grabs the characters between.
This for now to the regex, later more. At the moment we will give it a first try.
Choose the Watch4It complication on a watch on your apple watch. Read the instructions, if you don’t know how: https://support.apple.com/en-us/HT205536
There are different kind of complications for different watchfaces. WatchForIt supports 4 different kind of complications. As a hint: The Modular watch face has a complication with 3 lines, if you want to show more Text.
From now on, every 1/4 hour the app will load the website, run the regex and send the result to the watch. Touch the “Send to watch” button in the app to force to send now. Give a few seconds and the string should show in your complication. Try this with the other examples.
With the http:://4johannes.de/cgi-bin/mirrot.php?para=this%20is%20it example you can send yourself a fixed string to the watch. Just change the “this%20is%it” part. ( The %20 means a blank ” ” in HTML ).
- Help: Shows the help (this) page)
- Open List: Shows the list of example and your url/regex entries
- GetURL: Fetches the source of the site
- Regex: Runs reges on the source
- Send to watch: Sends the string to the watch
- Save to list: Adds the actual URL and Regex entry to the list. (Swipe in the list to delete entries).
- To reset the example list, delete every entry.
- What is in the URL and Regex fields will be used.
- Don’t forget to save
The interface on the watch is very simple, as we are only interested in the complication. It’s only 2 buttons and a textfield. The textfield shows the text which was shown by the iPhone. With the button “Call iPhone” you force a connection to build up: The watch want’s the iPhone to send a new string. The button “Restart Backpc” restarts the background process for fetching a new string. But remember this will only be done every 1/4 hour.