MagicMirror² v2.14.0 is available! For more information about this release, check out this topic.

Get value from Input Box

  • Hi Guys,

    I am new to development but love the features and modules which MM offers.
    I would however would like to use a string inputted into a hidden input box terminated by return to hit a webservice and update MM to display the results.

    Is there anyone that can point me in the right direction to get this going ?

    Appreciate the help.

  • Moderator

    @shvncrvn This seems a little bit too vague to me. Are you trying to reach an external webservice (like google?), where you would input something into the box, and display that result on your mirror? If yes, you can try to find out if this webservice uses POST or GET requests to retrieve the data (through developer console of your browser) or maybe even has an API, or anything like that, and send a request to that the same URL.

    In this case you can look at this module and see if it works for you.

  • @Jopyth thanks for the response. Basically I want a bar-code scanner (attached to the rpi) to read a bar-code and send a request to a web service, which entails updates magicmirror. The module you mentioned could work for retrieving the data but me sending an input string in real time to the mirror is what I am unsure of.

  • Moderator

    @shvncrvn Well, that depends on how your scanner is connected? Is there any library or project that already can read a code from it?

  • @Jopyth Yup a bar code scanner hooks up to USB and basically just emulates a keyboard by typing in the numbers of the bar code it scanned. It doesn’t need any special drivers.

  • Moderator

    @shvncrvn Well then you might just do something like this (needs jquery) in your module, and catch the typing of the scanner.

Log in to reply