Rohan Shewale's Blog

OneQuo.tk - a one quote website


The only function of this site is to display “ONE QUOTE” thus the name — oneQuo.tk ; A simple one page design looks beautiful and only one quote stands out of all the distractions.

It was a simple experiment using procedural PHP and MySQL to pull out a single random quote from the database and present it to the user. Quotes are requested to a getQ() function, which also accepts arguments(categories) and returns a random quote.

The thing which I actually wanted to do was to use ‘#’ as slug for different categories rather than just their name, i.e. Anime will be #anime. Though anything after a ‘#’ is not sent to the server but used by web browsers to relocate to the specific section (ID) of the page, but what’s the fun in that.

onequo_tk_rohan_shewale

The solution is not so amazing nor practical for any serious use. The work here is done by Ajax, the categories are links with onClick() function, and categories codes are sent to a single function which

  1. Send a get quote request to the server
  2. On receiving, change the URL using document.location()
  3. Replace the existing quote with the new one

A model is also added for users to submit their quote to the site, this is then added to a staged table which is screened for approval, if legit it’s moved to the main quote table.

Many things need to be done

  • Adding open graph for better sharing.
  • Changing type face
  • Including more categories
  • Auto load random quote in few minutes
  • Better UX
  • And the most important! Populating the database!

My favorite category #sarcastic


Article Publish Date: August 16, 2016