SlideShare a Scribd company logo
1 of 16
Download to read offline
REST
  ili kao sam se prestao brinuti
       o HTTP-u i zavolio ga
(HTTP Server sa RFID driverom)


            Dobrica Pavlinušić
       http://www.rot13.org/~dpavlin/
HULK, Knjižnica Filozofskog fakulteta u Zagrebu
    ITShowoff, Zagreb, 12. veljače 2010.
Zašto?

    Razviti podršku za
 posuđivanje i vraćanje
knjiga RFID tehnologijom
     preko browsera!

Kartica na čitaču treba dvosmjernu
      komunikaciju sa Kohom!
3M RFID protokol
●   3M software za korisnike
     – Visual Basic iz 90-tih
     – Ne prikazuje SID-ove RFID čipova
     – Prikazuje 5 čipova istovremeno
     – Automatski copy/paste u drugu
       Windows aplikaciju
●   USB serial
    protokol sa
    RFID čitačem
3M RFID protokol
●   Portmon za pregled USB prometa
     – Windowsi pod KVM-om
●   Otkriti sve mogućnosti
     – čitanje 25 čipova istovremeno
     – koliko podataka stane na RFID čip
     – kako funkcionira security
●   Protokol ima CCITT checksum
     – StackOverflow korisnik selwyn rješio
       moj problem!
Comet = Meteor + RFID




 http://www.youtube.com/watch?v=ptWv4fFJ6Q8
ETOOMUCH

                    Koha           HTTP
                                   Koha
RFID                HTTP                      Web
driver            book info                 browser

         socket                     HTTP
                              striped book info



 Meteor Comet server: single point of falure
KISS: JSONP

                    Koha           HTTP
                                   Koha
 RFID
driver                                      Web
JSONP                                     browser
                   HTTP JSONP
                  127.0.0.1:9000




         Svaki JSONP poziv je nezavisan!
           Pull RFID čitača iz browsera
RFID + HTTP/JSONP




  http://www.vimeo.com/9348504
REST
●   Scan
GET http://localhost:9000/scan?callback=foo
foo({"time":1265896293,"tags":
[{"sid":"E00401001F778B5D","custom":0,"content":"","library":0,
"branch":0,"total":0,"u1":0,"u2":0,"security":"00","type":0,"se
t":0}]})

●   Program
GET http://localhost:9000/program?E00401001F778B5D=201002120042
302 Location

GET http://localhost:9000/program?E00401001F778B5D=blank
REST
●   Security
     – Vraćanje (check-in)
     – Posuđivanje (check-out)
     – Automatski kod programiranja
GET http://localhost:9000/secure?E00401001F778B5D=DA
302 Location

GET http://localhost:9000/secure?E00401001F778B5D=D7
302 Location

GET http://localhost:9000/secure.js?E00401001F778B5D=DA
JSONP

GET http://localhost:9000/secure.js?E00401001F778B5D=D7
JSONP
HTTP tweaks
●   Etag: visible-E00401001F77478C
     – Not supported in our jQuery 1.2.3 until
       http://github.com/jquery/jquery/commit/28
     – RFID driver zna promjene pa bi ih
       mogao gurnuti klijentu za DOM update
●   HTTP je state-less
     – Omogućava povezivanje više klijenata
       istovremeno (trenutno lokalni i Koha)
Koha modifications
●   Find element to     ●   Append your data
    hook into




●   Minimalne modifikacije aplikacije
    – <script src="koha-rfid.js">
    – 2.5K JavaScript-a...
Koha + RFID = RIA
         ●   In-browser!
         ●   JSONP /scan
         ●   Inteligentan form
             fill-in + submit
         ●   Screen scraping
             za security
         ●   Nema modfikacije
             Kohe!
         ●   Single-origin
             policy je pain
Buzzword Bingo
●   Napravite prototip
●   Ako izgleda prekomplicirano – jest
●   KISS – keep it simple and stupid!
●   Sve može biti web-enabled!
Više informacija
Portmon for Window (serial sniffer)
 ● http://technet.microsoft.com/en-
   us/sysinternals/bb896644.aspx
Izvorni kod
 ● http://svn.rot13.org/index.cgi/RFID/
CCITT checksum pitanje
 ● http://stackoverflow.com/questions/149617/how-
   could-i-guess-a-checksum-algorithm
Meteor Comet server with RFID
 ● http://blog.rot13.org/2009/04/comet_experiment_rfid_
   reader_with_koha_data_in_browser.html
Hitchhiker's guide to RFID
 ● http://saturn.ffzg.hr/rot13/index.cgi?
   hitchhikers_guide_to_rfid
Pitanja?
   42

More Related Content

Viewers also liked

Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?Dobrica Pavlinušić
 
CTE Teaching and Learning Inst. 2008
CTE Teaching and Learning Inst. 2008CTE Teaching and Learning Inst. 2008
CTE Teaching and Learning Inst. 20081LifelongLearner
 
Re-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent StorytellingRe-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent StorytellingPaleFire
 
The Great Highland Bagpipe
The  Great  Highland  BagpipeThe  Great  Highland  Bagpipe
The Great Highland Bagpipe1LifelongLearner
 
Virtual Reality Applications in Career Consulting - Potential & Restictions
Virtual Reality Applications in Career Consulting  - Potential & RestictionsVirtual Reality Applications in Career Consulting  - Potential & Restictions
Virtual Reality Applications in Career Consulting - Potential & RestictionsDr Stylianos Mystakidis
 
Kako napraviti Google od zgrade sa računalima?
Kako napraviti Google od zgrade sa računalima?Kako napraviti Google od zgrade sa računalima?
Kako napraviti Google od zgrade sa računalima?Dobrica Pavlinušić
 
The Constellation Query Language
The Constellation Query LanguageThe Constellation Query Language
The Constellation Query LanguageClifford Heath
 
Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Dobrica Pavlinušić
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Dobrica Pavlinušić
 
Social Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for ChoirsSocial Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for ChoirsDr Stylianos Mystakidis
 
Spectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivismSpectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivismPaleFire
 
Pubic Diplomacy and Web 2.0
Pubic Diplomacy and Web 2.0Pubic Diplomacy and Web 2.0
Pubic Diplomacy and Web 2.0stefan.geens
 
Free Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG libraryFree Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG libraryDobrica Pavlinušić
 
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...PaleFire
 
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...Dr Stylianos Mystakidis
 

Viewers also liked (20)

Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?
 
CTE Teaching and Learning Inst. 2008
CTE Teaching and Learning Inst. 2008CTE Teaching and Learning Inst. 2008
CTE Teaching and Learning Inst. 2008
 
Re-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent StorytellingRe-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent Storytelling
 
The Great Highland Bagpipe
The  Great  Highland  BagpipeThe  Great  Highland  Bagpipe
The Great Highland Bagpipe
 
Virtual Reality Applications in Career Consulting - Potential & Restictions
Virtual Reality Applications in Career Consulting  - Potential & RestictionsVirtual Reality Applications in Career Consulting  - Potential & Restictions
Virtual Reality Applications in Career Consulting - Potential & Restictions
 
Web scale monitoring
Web scale monitoringWeb scale monitoring
Web scale monitoring
 
Kako napraviti Google od zgrade sa računalima?
Kako napraviti Google od zgrade sa računalima?Kako napraviti Google od zgrade sa računalima?
Kako napraviti Google od zgrade sa računalima?
 
The Constellation Query Language
The Constellation Query LanguageThe Constellation Query Language
The Constellation Query Language
 
Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?
 
Open Education in Virtual Worlds
Open Education in Virtual WorldsOpen Education in Virtual Worlds
Open Education in Virtual Worlds
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3
 
What Is Powerpoint
What Is PowerpointWhat Is Powerpoint
What Is Powerpoint
 
Oslobodimo Hardware
Oslobodimo HardwareOslobodimo Hardware
Oslobodimo Hardware
 
Social Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for ChoirsSocial Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for Choirs
 
Spectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivismSpectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivism
 
Pubic Diplomacy and Web 2.0
Pubic Diplomacy and Web 2.0Pubic Diplomacy and Web 2.0
Pubic Diplomacy and Web 2.0
 
Open Workshop on Information Literacy
Open Workshop on Information LiteracyOpen Workshop on Information Literacy
Open Workshop on Information Literacy
 
Free Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG libraryFree Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG library
 
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
 
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
 

More from Dobrica Pavlinušić

Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernelsMainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernelsDobrica Pavlinušić
 
Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !Dobrica Pavlinušić
 
Let's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionLet's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionDobrica Pavlinušić
 
Raspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsRaspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsDobrica Pavlinušić
 
Cheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerCheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerDobrica Pavlinušić
 
FSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGFSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGDobrica Pavlinušić
 
Hardware hacking for software people
Hardware hacking for software peopleHardware hacking for software people
Hardware hacking for software peopleDobrica Pavlinušić
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloudDobrica Pavlinušić
 
This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?Dobrica Pavlinušić
 
KohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID systemKohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID systemDobrica Pavlinušić
 
Virtualization which isn't: LXC (Linux Containers)
Virtualization which isn't: LXC (Linux Containers)Virtualization which isn't: LXC (Linux Containers)
Virtualization which isn't: LXC (Linux Containers)Dobrica Pavlinušić
 
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...Dobrica Pavlinušić
 

More from Dobrica Pavlinušić (18)

Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernelsMainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
 
Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !
 
bro - what is in my network?
bro - what is in my network?bro - what is in my network?
bro - what is in my network?
 
Let's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionLet's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 edition
 
Raspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsRaspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needs
 
Cheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerCheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component tester
 
Ganeti - build your own cloud
Ganeti - build your own cloudGaneti - build your own cloud
Ganeti - build your own cloud
 
FSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGFSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAG
 
Hardware hacking for software people
Hardware hacking for software peopleHardware hacking for software people
Hardware hacking for software people
 
Gnu linux on arm for $50 - $100
Gnu linux on arm for $50 - $100Gnu linux on arm for $50 - $100
Gnu linux on arm for $50 - $100
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
 
This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?
 
SysAdmin cookbook
SysAdmin cookbookSysAdmin cookbook
SysAdmin cookbook
 
Printing on Linux, simple right?
Printing on Linux, simple right?Printing on Linux, simple right?
Printing on Linux, simple right?
 
KohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID systemKohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID system
 
Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
 
Virtualization which isn't: LXC (Linux Containers)
Virtualization which isn't: LXC (Linux Containers)Virtualization which isn't: LXC (Linux Containers)
Virtualization which isn't: LXC (Linux Containers)
 
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
 

REST ili kao sam se prestao brinuti o HTTP-u i zavolio ga (HTTP Server sa RFID driverom)

  • 1. REST ili kao sam se prestao brinuti o HTTP-u i zavolio ga (HTTP Server sa RFID driverom) Dobrica Pavlinušić http://www.rot13.org/~dpavlin/ HULK, Knjižnica Filozofskog fakulteta u Zagrebu ITShowoff, Zagreb, 12. veljače 2010.
  • 2. Zašto? Razviti podršku za posuđivanje i vraćanje knjiga RFID tehnologijom preko browsera! Kartica na čitaču treba dvosmjernu komunikaciju sa Kohom!
  • 3. 3M RFID protokol ● 3M software za korisnike – Visual Basic iz 90-tih – Ne prikazuje SID-ove RFID čipova – Prikazuje 5 čipova istovremeno – Automatski copy/paste u drugu Windows aplikaciju ● USB serial protokol sa RFID čitačem
  • 4. 3M RFID protokol ● Portmon za pregled USB prometa – Windowsi pod KVM-om ● Otkriti sve mogućnosti – čitanje 25 čipova istovremeno – koliko podataka stane na RFID čip – kako funkcionira security ● Protokol ima CCITT checksum – StackOverflow korisnik selwyn rješio moj problem!
  • 5. Comet = Meteor + RFID http://www.youtube.com/watch?v=ptWv4fFJ6Q8
  • 6. ETOOMUCH Koha HTTP Koha RFID HTTP Web driver book info browser socket HTTP striped book info Meteor Comet server: single point of falure
  • 7. KISS: JSONP Koha HTTP Koha RFID driver Web JSONP browser HTTP JSONP 127.0.0.1:9000 Svaki JSONP poziv je nezavisan! Pull RFID čitača iz browsera
  • 8. RFID + HTTP/JSONP http://www.vimeo.com/9348504
  • 9. REST ● Scan GET http://localhost:9000/scan?callback=foo foo({"time":1265896293,"tags": [{"sid":"E00401001F778B5D","custom":0,"content":"","library":0, "branch":0,"total":0,"u1":0,"u2":0,"security":"00","type":0,"se t":0}]}) ● Program GET http://localhost:9000/program?E00401001F778B5D=201002120042 302 Location GET http://localhost:9000/program?E00401001F778B5D=blank
  • 10. REST ● Security – Vraćanje (check-in) – Posuđivanje (check-out) – Automatski kod programiranja GET http://localhost:9000/secure?E00401001F778B5D=DA 302 Location GET http://localhost:9000/secure?E00401001F778B5D=D7 302 Location GET http://localhost:9000/secure.js?E00401001F778B5D=DA JSONP GET http://localhost:9000/secure.js?E00401001F778B5D=D7 JSONP
  • 11. HTTP tweaks ● Etag: visible-E00401001F77478C – Not supported in our jQuery 1.2.3 until http://github.com/jquery/jquery/commit/28 – RFID driver zna promjene pa bi ih mogao gurnuti klijentu za DOM update ● HTTP je state-less – Omogućava povezivanje više klijenata istovremeno (trenutno lokalni i Koha)
  • 12. Koha modifications ● Find element to ● Append your data hook into ● Minimalne modifikacije aplikacije – <script src="koha-rfid.js"> – 2.5K JavaScript-a...
  • 13. Koha + RFID = RIA ● In-browser! ● JSONP /scan ● Inteligentan form fill-in + submit ● Screen scraping za security ● Nema modfikacije Kohe! ● Single-origin policy je pain
  • 14. Buzzword Bingo ● Napravite prototip ● Ako izgleda prekomplicirano – jest ● KISS – keep it simple and stupid! ● Sve može biti web-enabled!
  • 15. Više informacija Portmon for Window (serial sniffer) ● http://technet.microsoft.com/en- us/sysinternals/bb896644.aspx Izvorni kod ● http://svn.rot13.org/index.cgi/RFID/ CCITT checksum pitanje ● http://stackoverflow.com/questions/149617/how- could-i-guess-a-checksum-algorithm Meteor Comet server with RFID ● http://blog.rot13.org/2009/04/comet_experiment_rfid_ reader_with_koha_data_in_browser.html Hitchhiker's guide to RFID ● http://saturn.ffzg.hr/rot13/index.cgi? hitchhikers_guide_to_rfid
  • 16. Pitanja? 42