TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Bucket List SwiftUI Tutorial: Downloading data from Wikipedia - How to download the text from the Wikipedia article?

Forums > Articles

Hi all, I want to make an app in which text from a Wikipedia article should be shown. In the 'Downloading data from Wikipedia' tutorial, only the titles of the articles are being shown. So my question is: Is there a way to also download and show the other text from the article, rather than only the title?

Link to article: https://www.hackingwithswift.com/books/ios-swiftui/downloading-data-from-wikipedia

4      

In the acticle, it state

Each page has a lot of information, including its coordinates, title, terms, and MORE.

So you need to find the field(s) and add that to the struct Page

4      

Thanks for your help! I am able to download the text from the article now.

However, I ran into another problem. In my project, I want to show an article about power functions. I use this link: https://en.wikipedia.org/w/api.php?action=query&titles=cubic_function&prop=extracts&format=json&exchars=500&explaintext&exsectionformat=plain.

Now the problem is: the extract I get is a string (open the link to see it) that contains a formula, which looks weird in a swift string.

Is there a way to solve this problem with swift?

4      

Hacking with Swift is sponsored by Superwall.

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.