MagicMirror² v2.4.1 is available! For more information about this release, check out this topic.
Please read the release notes carefully since this update requires adjustments to your Raspberry Pi configuration!

Random Quotes


  • Moderator

    I forgot who asked me to release my code, it may have been @paviro, but I honestly don’t remember. One of the very first modules I wanted was something that displays a random quote, so I modified the supplied ‘Compliments’ one to my needs. I used the popular http://www.brainyquote.com web site to fetch quotes, however they don’t provide an API. And looking around the web, all of the random quotes web sites that I found with an API only allows you one random quote per day. If you want a random one each time you send a request, then you need to subscribe and pay them. So, in keeping the ‘free’ nature of the module, I decided to hard code a few categories and quotes from each from BrainyQuote. If you want to edit the quotes, you’ll have to do that in the module’s js file.

    http://github.com/KirAsh4/random_quotes/

    0_1466446564627_quote.png



  • I just installed it. it’s working fine, Did send you a PR there were some typos in the readme file. some people wouldn’t be able to install it with that typos.


  • Moderator

    Thanks, merged into dev. Will push it to master as well.



  • Hi, I am very bad with javascript is it possible to load the quotes from a text file?


  • Moderator

    Not as written. It would require a bit of rewriting to allow for a local call to a file. Not impossible, just not written.



  • so is that right that you put the information from your script not from brainyguote?
    so i can change it in vocal to learn an another language ?
    i mean its only a script what change the text per time ?
    if that is it that i am thanksfull
    that i need it (for example for my english…)


  • Moderator

    All the quotes are in the random_quotes.js file. You can change them to anything you want.



  • so i have to add the paramteres (updateintervall etc) in my config ?

    because in your example wasn’t that
    very thank you!

    ‘modules: [
    {
    module: ‘random_quotes’,
    position: ‘lower_third’,
    config: {
    updateIntervall=500 // The config property is optional
    fadeSpeed=4 // Without a config, a random quote is shown,
    category=random // selected from all of the categories available.
    }
    }
    ]’


  • Moderator

    Correct, as the documentation shows.



  • @geeflaxx you need to write it down like this

    {
        module: 'random_quotes',
        position: 'lower_third',
        config: {
            updateIntervall: 500,
            fadeSpeed: 4,
            category: 'random'
        }
    }