Learn how to retrieve the data of an API over a CURL connection and evaluate the JSON to build a weather station. This example uses a free key from the OpenWeather API. The API returns a JSON text containing information such as current weather description, current temperature, pressure, humidity and many more.
The structure is simpler than XML which makes it much smaller and since it does not make use of all the tags you’ll find in XML, it is also significantly easier to read. However, if you open unformatted JSON in a text editor you’ll probably find it a bit dense. Here’s how to get around that.
I love the new Star Trek Discovery and there are a fair amount of Klingons in it, from time to time. It occurred to me that someone has probably built a web service to translate English to Klingon and if so, I needed to build a Xojo app to use it.
A quick Google search turned up an API by FunTranslations: https://funtranslations.com/api/klingon
It has simple usage where you send along the text in English and you get back a JSON result containing the text translated to Klingon. Here’s the result of my 15 minutes of effort to use this in a Xojo desktop app:
For the 10th week of the #JustCode Challenge I took a look at networking. For my project this week I’ve created a networked version of the Combat game, which has two tanks on the screen shooting at each other. The network version allows you to control one tank with the app running on your computer and someone else to control the other tank with the app running on their computer. I call it NetTank.
We’re wrapping up week 9 of #JustCode with a web app that demonstrates a web service, JSON and SQLite. The web app functions as both an app with a UI and a web service. It lets you enter your own quotes which are saved in a SQLite database. The web service randomly fetches a quote and returns it as JSON.
A long, long time ago (1989) one of the first apps I ever made was an app launcher for the Atari ST. I called it JumpSTART. I originally wrote it in GFA BASIC and then later re-implemented it in Pascal (OSS Personal Pascal, technically).
I was reminded of JumpSTART when I saw my dock getting crowed. I thought replicating JumpSTART in Xojo would be a good project for week 8 of #JustCode. Though let’s just call it JumpStart this time around.
We’re starting a new thing! At the end of each month we’ll round up a few of our favorite things – from blog posts, announcements, technology, science and whatever other stuff the Xojo team thinks was noteworthy and I’ll post it. It’s the new Xojo Monthly Round Up!
Recently, a new syndication format was introduced by Brent Simmons and Manton Reece called JSON Feed. It is an alternative to RSS/Atom to get feeds for blog posts and podcasts. RSS/Atom are XML-based making them complex to work with. As its name implies JSON Feed uses JSON and is much simpler. I’ve shown in previous posts how easy it is to make a web and iOS apps with Xojo to display the feed.
In this post, I’ll show you how to create a Xojo desktop app to display the JSON feed for Daring Fireball in less than 20 lines of code. This app works without changes on macOS, Windows and Linux.