The purpose behind this project is the database for the Android and iPhone Quote of the Day app. This page essentially pulls the same information and behaves the same as the apps. It was necessary to get this page up and running before even beginning work on the apps.
This page is 100% complete. As of 9/21/2017, both of the mobile apps are complete too.
Social icons appear here
NEW: I have created a Twitter Bot for this. If you don't want to download the app, you can follow the Twitter account, and get your daily quote there.Follow @DPQuoteOfTheDay
Current status of the apps - 08-15-2017: Android App is 100% finished.
Current status of the apps - 09-21-2017: iOS App is 100% finished. Apple has approved the app.
I tried to get the apps to look and behave exactly the same. And they are pretty close. The only real differences are as follows:
An Application Programming Interface is an interface or communication protocol between a client and a server intended to simplify the building of client-side software. In short, if you need to perform the same function over and over again, like pulling a record from a database, it is sensible to write a single API that can be called from anywhere at any time, that does nothing but return the desired result.
We are making the API that makes this thing run open to anyone that wants to use it. The database now holds some 4 years worth of quotes. And there are always more coming in. Users submit new quotes about as often as I do. I have already used this project for a number of things, and I suspect that people would probably find it useful for their own projects. So we are allowing the API to be used openly. As long as this service doesn't get abused, it will remain free for the foreseeable future.
The link to call the API is:
Running the API right now will return the JSON:
[["540","A bartender is just a pharmacist with a limited inventory.","Anonymous","Bumper Sticker","2017-07-24 17:45:11","","webform","2020-01-18","","Humor"]]
The argument "echoquote=2" tells the API to return just today. If you use "echoquote=3", it will return 30 days worth. It starts with today minus 1 week and goes out 3 weeks. The following code really only addresses a single quote. If you wish to use the 30-day version, modify the code to utilize the entire array, rather than just element .
This is easier than it sounds because it's already an array. You just need to know what the elements are:
3: Attributed to
4: Date Entered
7: Date FOR (today's date)
8: Link for attribution
The output can look like this:
Code for this:
Since I used PHP to call up the JSON, I used a PHP variable $quoteIs