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.
<div id="factOfTheDay"></div>
<script src="https://isocialPractice.github.io/factOfTheDay/js/factOfTheDay.js"></script>
- In an html document add any tag with the id attrubte set to
id="factOfTheDay"
. For example:
<div id="factOfTheDay"></div>
- Below the newly added html tag insert the below
script
tag as is:
<script src="https://isocialPractice.github.io/factOfTheDay/js/factOfTheDay.js"></script>
- 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.
- API - somewhere in
site root
- extracts json from API call
- NOTE - the current json file is just for example purposes.
- bin - somewhere in
site server
- a cronjob to get a daily json file
- IMPORTANT - do not put within
site root
.
- js - somewhere in
site root
- makes an AJAX request to get extracted date from API call.
License CC0 v1.0 Universal.