Problems with calling wikipedia API

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Problems with calling wikipedia API

Post by glenn9 » Fri Jan 29, 2021 10:54 am

Just wanted to say a big thank you to everyone for all the hints and tips re API calls - I think I'm starting to get the hang of it now which has enabled me to start exploring APIs from other sources.

Just another question... I've just built a small standalone which includes API calls but they don't seem to work in the standalone! They do however work fine when called within the IDE - is there something I need to do to allow them to be activated in a standalone?

Kind regards,

Glenn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Problems with calling wikipedia API

Post by FourthWorld » Fri Jan 29, 2021 3:57 pm

Check that "Internet" is among the selected inclusions in the Standalone Builder.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 161
Joined: Tue Feb 23, 2010 10:53 pm

Re: Problems with calling wikipedia API

Post by bobcole » Sat Jan 30, 2021 4:59 am

FourthWorld wrote:
Fri Jan 29, 2021 8:28 am
This quickie demo grabs the JSON and displays it as an array, then grabs the first image URL and displays it
Richard:
Your demo stack is a great learning tool. Awesome!
I looked through the script and found the API link you used:
https://en.wikipedia.org/api/rest_v1/#/ ... media-list
I am amazed that you could figure out that Wikipedia API web page so fast. And then write a working stack, too.
You are a tremendous resource for the LiveCode community; a brilliant gem.
Many thanks!
Bob

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Problems with calling wikipedia API

Post by FourthWorld » Tue Feb 02, 2021 6:56 pm

bobcole wrote:
Sat Jan 30, 2021 4:59 am
FourthWorld wrote:
Fri Jan 29, 2021 8:28 am
This quickie demo grabs the JSON and displays it as an array, then grabs the first image URL and displays it
Richard:
Your demo stack is a great learning tool. Awesome!
I looked through the script and found the API link you used:
https://en.wikipedia.org/api/rest_v1/#/ ... media-list
I am amazed that you could figure out that Wikipedia API web page so fast. And then write a working stack, too.
You are a tremendous resource for the LiveCode community; a brilliant gem.
Many thanks!
Bob
Thank you for the kind words, Bob. A lot of my work these days has me doing LC integrations with online services, so your post became a good test case for what I've been learning, how quickly I could come up with a usable solution.

Glad you posted that for other reasons as well: Wikipedia is a great resource, and I was unfamiliar with the scope of their APIs. They offer a surprisingly broad range of capabilities there, with good clean API design. Very glad you brought their API to my attention.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 161
Joined: Tue Feb 23, 2010 10:53 pm

Re: Problems with calling wikipedia API

Post by bobcole » Wed Feb 03, 2021 3:30 am

Richard:
I was successful building the stack as a standalone app but it took some trial and error to figure out what inclusions were needed.
Here are the inclusions I found were necessary:
  • Tree View
  • JSON Library
  • Internet
  • SSL & Encryption
  • Answer Dialog (the Ask Dialog seems to automatically check itself)
  • mergJSON
This project has also been a good opportunity for me to learn about the inclusions list.
Thanks for helping,
Bob

glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Problems with calling wikipedia API

Post by glenn9 » Wed Feb 03, 2021 1:57 pm

Hi Bob,

thanks for sharing this, have just tried it as well and the inclusions you suggested work perfectly in my desktop standalone and together with Jacque's advice viewtopic.php?f=7&t=35348#p201272 should work for Android as well.

Regards,

Glenn

Post Reply