April 2020

If you just want the API interface, please visit: Today's free API development documents in history


? Today InHistory | Today in history

Today's database in history, the data comes from "Wikipedia", and the demo address is: https://api.nowtime.cc/today_in_history.html

GitHub project address: https://github.com/PrintNow/TodayInHistory

It's good for you Don't forget to order a Start

? Tell me about the idea of reptiles

  1. Download first https://zh.wikipedia.org/wiki/1 Month 1
    reach https://zh.wikipedia.org/wiki/12 Month 31 366 days of pages (I took about 3 minutes to download them all)
  2. Then write the code( The best language in the world PHP). It took me a long time, about two or three hours (shame, limited level?)
  3. Export as after cleaning history_in_today.json file
  4. Then write the code( The best language in the world PHP) batch insert them into MySQL database
  5. Write API logic code. I use the ThinkPaPHP framework. Interface address: https://api.nowtime.cc/v1/today_in_history
  6. And then according to what I wrote before PrintNow/TimeLine Timeline, modified to index.html
  7. Then you see the project

? usage method

I prepared two copies of data history_in_today.sql and history_in_today.json
You can play freely, or use what I wrote, as follows?

  1. ? Prepare a PHP environment
  2. Download source code , after decompression Place site root directory
  3. take history_in_today.sql Import MySQL database
  4. Configure the database information in the api.php Lines 14-17
  5. Modify line 3 of [static/script. js] () to https://api.nowtime.cc/v1/today_in_history replace with Http://your domain name/api.php
  6. open Http://your domain name/index.html
  7. enjoy ?

? screenshot



-Read the rest-