Forismatic.com for Quotes & Expressions – the most inspiring expressions of mankind

Inspirational quotes
Image from iasbaba.com
Published: by
Last updated:
Categories
Website Development

An inspirational quote will always be a way to brighten up someone’s day. Forismatic.com is a great site with some solid APIs to get inspirational expressions in the form of a Windows screensaver, a quotes tray, iPhone and Mac OS applications and an Android client.

From their website

“Here we collect the most inspiring expressions of mankind.

There are not any catalogues of phrases or lists of authors on the site, full of sages and philosophers’ thoughts, writers and outstanding people’s aphorisms. We don’t believe in a random choice. Only you can guide your destiny. Just listen to yourself and one of the most inspiring expressions of mankind will be the sign for you.”

The Forismatic API

What is also handy is Forismatic’s API functionality. Random inspirational expressions can be called from, among other languages, Python libraries.

The current version of their API is 1.0. Expressions can be obtained in English (en) or Russian (ru).

API method calls are implemented in the form of HTTP requests to the URL

http://api.forismatic.com/api/1.0/

Query parameters are passed using POST or GET (URL-encoded) method. The server return data format is set by the query parameter. The following response formats are supported:

  • xml
  • json
  • jsonp
  • html
  • text

For more information, see the official Forismatic API section, but for those with less programming experience see the Python section below.

Python

Currently, there are at least two working Python libraries that can be used to obtain expressions, pyforismatic and notify-quote. After installation, these libraries are imported into the Python script which will then only need a simple command to retrieve a random quote.

pyforismatic

Andrey Basalyha wrote a nice, easy to use repository called pyforismatic, for this function. It is available on Bitbucket. To copy and unzip and install the repository to a Raspberry Pi, use the following lines in the terminal (while being in the desired base directory):

wget https://bitbucket.org/abasalyha/pyforismatic/downloads/forismatic-1.0.zip
unzip forismatic-1.0.zip
cd forismatic-1.0
sudo python setup.py install

After this, testing is as simple as running python example.py from the same directory. pyforismatic will automatically get quotes in English.

notify-quote

notify-quote is a GitHub repository written by Nithish Sankaranarayanan. To copy and unzip the repository to a Raspberry Pi, go to the desired base directory and use the following lines in the terminal:

wget https://github.com/snithish/notify-quote/archive/master.zip
unzip master.zip
cd notify-quote-master

Testing is as simple as running python notify-quote.py from the same directory.

Rate limitations

According to Forismatic, they have a “smart algorithm to ban host and apps that request quotes more frequently then humans read them”. When it is overused, the user will be banned.

About the author
Renier busies himself with improving his English writing, creative web design and his websites, photoshopping, micro-electronics, multiple genres of music, superhero movies and badass series.

Save, share & Disqus

Use the buttons below, on the left or the bottom of this page to share this post. Your comment is important, but don't be a knob. Keep it constructive and polite.

Comment via Disqus

Disqus is a worldwide comment hosting service for web sites and online communities. This secure platform ensures a pleasant commenting environment which is manageable from one account. Use the Login button to sign up.

More website development related posts

Discover the easy way to send bulk SMS from your PC, Mac or mobile device
Discover the easy way to send bulk SMS from your PC, Mac or mobile device
25 April 2019
Ad: Using the latest in technology, WinSMS offers cost effective messaging solutions that makers and business owners can use. With their online portal and API functionality, buying SMS bundles and sending them to recipients is more cost effective and easy to do. More…
Using Cron to schedule tasks
Using Cron for scheduling tasks
30 June 2017 | Updated 11 July 2017
Cron is an Unix-like operating system software utility used to schedule automatic time-based commands. Entered commands can be in the form of Bash or Bash scripts that are meant to be automatically executed periodically at fixed times, dates or intervals. More…