refugio-org / refugio

refug.io project
MIT License
0 stars 0 forks source link

qrcode #1

Closed denjello closed 10 years ago

denjello commented 10 years ago

Solution 1:

habe vorhin diesen qrcode as a service gefunden.

These code snippets use an open-source library, for more information visit: http://unirest.io/nodejs.html

CODE: var Request = unirest.get("https://mutationevent-qr-code-generator.p.mashape.com/generate.php?content=http%3A%2F%2Frefugio-test.herokuapp.com%2F52ab21865acceb0200000013&quality=%3Cquality%3E&size=%3Csize%3E&type=url") .headers({ "X-Mashape-Authorization": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }) .end(function (response) { console.log(response); });

RESPONSE { "original_text": "http://refugio-test.herokuapp.com/52ab21865acceb0200000013", "image_url": "http://qrcode.mutationevent.com/img/QR6b0c8e9bbb18fb732094582885d8dd1d.png" }

cryptix commented 10 years ago

nice, this looks easy!

denjello commented 10 years ago

Solution 2:

writing our own local service (which we can do when we move to a dedicated service) is also pretty easy. for example as a bash script using qrencode eg:

on debian>

apt-get install qrencode imagemagick

./qrcode.sh 98123hdas127r4342

!/bin/bash

qrencode 'http://refugio-test.herokuapp.com/token/'$1 -o "/var/www/public/${1}.png" -d 92 -l M

98123hdas127r4342

denjello commented 10 years ago

Solution 3:

let the browser do it all.

http://davidshimjs.github.io/qrcodejs/

cryptix commented 10 years ago

The size of the the QRCode should be tweaked I guess.

And the API Key should be set through heroku and not exposed in the repo...