Skip to content

Get today's featured content from English Wikipedia to use in html.

License

Notifications You must be signed in to change notification settings

isocialPractice/factOfTheDay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fact of the Day

This repository works with the ctrl + click Wikimedia API Portal. It calls the API and gets the day's featured article(s) from Wikipedia. The results are stored in a JSON file, and the output is an extract that day's featured article.

To see a working sample ctrl + click Fact of The Day Example.

Quickstart - copy/paste below into html file:

<div id="factOfTheDay"></div>
<script src="https://isocialPractice.github.io/factOfTheDay/js/factOfTheDay.js"></script>

Instructions

  1. In an html document add any tag with the id attrubte set to id="factOfTheDay". For example:
<div id="factOfTheDay"></div>
  1. Below the newly added html tag insert the below script tag as is:
<script src="https://isocialPractice.github.io/factOfTheDay/js/factOfTheDay.js"></script>
  1. Add any additional elements or styling as needed.

To use with additional functionality; copy, clone, and/or extract this repo and make edits as needed. For the most part the comments within each file should provide quasi-instructions.

DIRECTORY NOTES:

  1. API - somewhere in site root
    • extracts json from API call
    • NOTE - the current json file is just for example purposes.
  2. bin - somewhere in site server
    • a cronjob to get a daily json file
    • IMPORTANT - do not put within site root.
  3. js - somewhere in site root
    • makes an AJAX request to get extracted date from API call.

License CC0 v1.0 Universal.

About

Get today's featured content from English Wikipedia to use in html.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published