Coding Challenge #75: Wikipedia API
The Coding Train The Coding Train
1.68M subscribers
315,312 views
0

 Published On Sep 25, 2017

In this coding challenge, I make a "Wikipedia web crawler" in JavaScript. It randomly crawls from topic to topic on Wikipedia using the API and the p5.js library. Code: https://thecodingtrain.com/challenges...

šŸ•¹ļø p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s...

šŸŽ„ Previous video: Ā Ā Ā ā€¢Ā CodingĀ ChallengeĀ #74:Ā ClockĀ withĀ p5.jsĀ Ā 
šŸŽ„ Next video: Ā Ā Ā ā€¢Ā CodingĀ ChallengeĀ #76:Ā 10PRINTĀ inĀ p5.jsĀ Ā 
šŸŽ„ All videos: Ā Ā Ā ā€¢Ā CodingĀ ChallengesĀ Ā 

References:
šŸŒ Wikipedia API Help: https://www.mediawiki.org/wiki/API:Ma...

Videos:
šŸš‚ Videos on working with data and APIs: Ā Ā Ā ā€¢Ā WorkingĀ withĀ DataĀ andĀ APIsĀ inĀ JavaScriptĀ Ā 
šŸš‚ My Videos on Regular Expressions: Ā Ā Ā ā€¢Ā 2.1:Ā IntroductionĀ toĀ RegularĀ Expressi...Ā Ā 
šŸ”“ Coding Train Live 101: Ā Ā Ā ā€¢Ā CodingĀ TrainĀ LiveĀ 101:Ā "let"Ā vsĀ "var"...Ā Ā 

Related Coding Challenges:
šŸš‚ #84 Word Definition Chrome Extension: Ā Ā Ā ā€¢Ā CodingĀ ChallengeĀ #84:Ā WordĀ Definition...Ā Ā 

Timestamps:
0:00 Introducing today's topic: a Wikipedia web crawler
1:17 Add an input box to the html
2:48 Handle the user input event
4:45 The Wikipedia search URL
6:45 Use loadJSON to request a page
9:52 Pick a random article title
11:36 Use a regular expression to replace the white space
12:28 Retrieve the content using the content URL
14:58 Look at the json file with the Chrome extension Json formatter
16:37 Use the key to get the page Id
19:53 Use a regular expression to get the words on a page
21:55 Use a random word to crawl a bunch of random articles
22:55 Add an exit condition
24:12 Conclusion

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

šŸš‚ Website: http://thecodingtrain.com/
šŸ‘¾ Share Your Creation! https://thecodingtrain.com/guides/pas...
šŸš© Suggest Topics: https://github.com/CodingTrain/Sugges...
šŸ’” GitHub: https://github.com/CodingTrain
šŸ’¬ Discord: https://thecodingtrain.com/discord
šŸ’– Membership: http://youtube.com/thecodingtrain/join
šŸ›’ Store: https://standard.tv/codingtrain
šŸ–‹ļø Twitter: Ā Ā /Ā thecodingtrainĀ Ā 
šŸ“ø Instagram: Ā Ā /Ā the.coding.trainĀ Ā 

šŸŽ„ Coding Challenges: Ā Ā Ā ā€¢Ā CodingĀ ChallengesĀ Ā 
šŸŽ„ Intro to Programming: Ā Ā Ā ā€¢Ā StartĀ learningĀ here!Ā Ā 

šŸ”— p5.js: https://p5js.org
šŸ”— p5.js Web Editor: https://editor.p5js.org/
šŸ”— Processing: https://processing.org

šŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#webcrawler #wikipediaapi #regularexpressions #loadjson #javascript #p5js

show more

Share/Embed