Jump to content
IGNORED

Web Based Applets that use TIPI...


dgrissom

Recommended Posts

 I've been using these new features with @Asmusr's JS99'er and @jedimatt42's "http://tipi:9900/files" interface. 

 

I used Notepad++ to work on a number of JSON and non-JSON web applets.  All of these are in @matthew180's TIDBIT format and most will run on stock Extended BASIC.

There are 2 files (PIJOKE8.TB and PIQUOTE8.TB) that require  @senior_falcon's XBGEM to run the 40/80 column versions (change the default screen widths in code code).

 

It's a pleasure to sit down and put together these programs using the TIPI and TIPI emulation while using JS99'er.net.  

 

These applets include Bible Verses, Jokes, Quotes, Insults, and Weather data. 

(I have a few more files.  However, they use embedded personal keys to access the information.  I can include an example or two if these is any interest?)

 

Hopefully, these illustrate the power of the newest version of TIPI. 

The TIDBIT files are heavily commented and can be used as examples to retrieve all kinds of different information from the internet.

I hope but don't fully guarantee them to be "bug-free" 😉

 

If you find these useful,  feel free to share and add to them...

 

 

D.Grissom

 

 

 

PIJSONTests.zip

  • Like 4
Link to comment
Share on other sites

It is cool to see that the FCMDXB program is used to jump back into ForceCommand from within an XB program. Nice!

 

Also, looking at the weather PIWEATH.TB, I'll just point out that the SUB PARSE isn't used, as you were able to skip that complexity by using the TIPI JSON query feature. 

 

This is good stuff!

 

The ?J feature works with local files as well.. so you could probably handle services that use personal keys by stashing the keys in a separate SECRETS file that is in easy to read JSON format. Something like: 

 

{
  "wheresmyphone": {
    "apikey": "1238128371837238273"
  },
  "whosatthedoor": {
    "login": "myuser@snailmail.com",
    "password": "Is this sentance a good passphrase?"
  }
}

 

which you could then query in the same way as you have the web resources... just open it with a local file path like: TIPI.?J.APPLETS.SECRETS  or something... just an idea. 

  • Like 2
Link to comment
Share on other sites

20 minutes ago, jedimatt42 said:

It is cool to see that the FCMDXB program is used to jump back into ForceCommand from within an XB program. Nice!

 

Also, looking at the weather PIWEATH.TB, I'll just point out that the SUB PARSE isn't used, as you were able to skip that complexity by using the TIPI JSON query feature. 

 

This is good stuff!

 

The ?J feature works with local files as well.. so you could probably handle services that use personal keys by stashing the keys in a separate SECRETS file that is in easy to read JSON format. Something like: 

 

{
  "wheresmyphone": {
    "apikey": "1238128371837238273"
  },
  "whosatthedoor": {
    "login": "myuser@snailmail.com",
    "password": "Is this sentance a good passphrase?"
  }
}

 

which you could then query in the same way as you have the web resources... just open it with a local file path like: TIPI.?J.APPLETS.SECRETS  or something... just an idea. 

That I will definitely try!

 

DG

  • Like 1
Link to comment
Share on other sites

5 hours ago, dgrissom said:

 

 

These applets include Bible Verses, Jokes, Quotes, Insults, and Weather data. 

(I have a few more files.  However, they use embedded personal keys to access the information.  I can include an example or two if these is any interest?)

 

 

How would these 'personal keys' be generated?

 

@InsaneMultitasker has been exploring some opportunities, and seeing your note the various applets, I am thinking short standalone assembly programs may be able to be written that can be added to an AUTOEXEC file on the Geneve to get some of that information as well.

  • Like 1
Link to comment
Share on other sites

1 hour ago, 9640News said:

How would these 'personal keys' be generated?

 

@InsaneMultitasker has been exploring some opportunities, and seeing your note the various applets, I am thinking short standalone assembly programs may be able to be written that can be added to an AUTOEXEC file on the Geneve to get some of that information as well.

Many of the sites out there require "API" keys.  Unfortunately, this requires you to register with them.  Of course, there is a risk for more spam.

 

I have at a key for "https://openweathermap.org/  The key is free for limited use.  (They offer "professional" level keys as well to access more information.)

 

The API pages show how the key is used in the https URL$

 

Example:  

    URL$="https://api.openweathermap.org/data/2.5/weather?q=Prattville,%20us&units=imperial&appid=xxxxxxxxxxxxxxxxxxxxxxxxxx"

(All the x's represent the "key".

 

The returned information is shown below:

{"coord":{"lon":-86.4597,"lat":32.464},"weather":[{"id":800,"main":"Clear","description":"clear sky",_
"icon":"01n"}],"base":"stations","main":{"temp":64.74,"feels_like":64.29,"temp_min":61.09,_
"temp_max":69.31,"pressure":1012,"humidity":72},"visibility":10000,_
"wind":{"speed":0,"deg":0},"clouds":{"all":0},"dt":1681522505,_
"sys":{"type":1,"id":2713,"country":"US","sunrise":1681471067,"sunset":1681517645},_
"timezone":-18000,"id":4084796,"name":"Prattville","cod":200}

Plug the JSON data fields you want to use into your code.  Format it and you should be good to go.

(Examples:  "temp", "humidity", "description")

 

I found a site that had at least a hundred API's.  A Google search will get you started.

 

Imagine using these at a computer demo!  Set up random access to some of these sites though your application and TI computer. 

 

BTW, a disclaimer, apply filters to some of the joke sites as they can be pretty rough!

 

The attached "EXWEATH.TB" is a pretty complete example.

 

D.Grissom

 

 

EXWEATH.TB

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...