HUBOTA LOOK INSIDE OUR ROBOT FRIEND
1.   Setting Up Hubot2.   Coffeescript Primer3.   Hubot Overview4.   APIs
(disclaimer: this assumes OSX. commands should       translate easily to windows and linux.)
PREREQUISITES              Install Node           be isalnd            rw ntl oe           Install and run Redisadd / s / ...
FIND A NICE HOME          c to directory of choice           drun h b t - a r o to generate a boilerplate     uo c ibt    ...
HELLO WORLD      run b n h b t           i/uotype h b t p n and hit enter      uo ig
A BRIEF DIVERSION INTO     COFFEESCRIPT
itoesg =(sr -nrMsae   ue) >  i ue?nm?adue?hby   f sr.ae n sr.ob?    "el,Ia #rsos.ae,"+     hlo  m {epnenm}         " #rsos...
HUBOT STRUCTUREP o f l (Heroku startup script) rcieRAM.d EDEmb n (contains hubot executable) i/e t r a - c i t . s n(list ...
A HUBOT SCRIPT    EXAMPLE  CREATE AND EDITSRPSGOBECFECIT/ODY.OFE
gobe =[ odys  "y,{ae.,   Be nm}"  "ae,{ae.,   Ltr nm}"  "aecr,{ae.   Tk ae nm}"]gobe=(ae -ody   nm) > idx=pren(ahrno( *gob...
run b n h b tagain     i/uosay g o b e H b t     ody uosay l t r H b t     ae, uo
HUBOT-SCRIPTS       GITHUB.COM/GITHUB/HUBOT-SCRIPTShubot will automatically download and keep up-to-date               any...
copy the dependencies from the hubot-script into your                  pcaejo                   akg.sn                from...
edit h b t s r p s j o       uo-cit.sn   add " l r . o f e        cakcfe"      run b n h b t           i/uosay h b t c a k...
HUBOT PERSISTANCE       simple storage through h b t b a n                               uo.ri     overloaded by redis-bra...
You can save any arbitrary data in the brain.#yumywn t wi utltebanhsbe iiilzd  o a at o at ni h ri a en ntaie#adteei adtbs...
HUBOT HTTP LISTENER   CREATE AND EDIT  SRPSSYCFE   CIT/A.OFE
qeytig=rqieursrnursrn   eur(qeytig)mdl.xot =(oo)-oueeprs    rbt > rbtrue.e "hbtsy,(e,rs -  oo.otrgt /uo/a" rq e) >   qey=q...
edit p c a e j o to include              akg.sn" u r s r n " " = 0 1 0 in the dependencies qeytig: > .."              run ...
DEPLOYMENT99 times out of 100, youll probably just deploy to Heroku     h b t - creates a Heroku P o f l for you      uo c...
CHAT ADAPTERSHubot ships with a Campfire adapter. You can get more                  from hubot-scripts.         Assuming H...
Hubot: a look inside our robot friend
Hubot: a look inside our robot friend
Hubot: a look inside our robot friend
Hubot: a look inside our robot friend
Hubot: a look inside our robot friend
Nächste SlideShare
Wird geladen in …5
×

Hubot: a look inside our robot friend

3.274 Aufrufe
3.009 Aufrufe

Veröffentlicht am

An overview of Hubot, describing setup and writing scripts.

Veröffentlicht in: Technologie
0 Kommentare
0 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Keine Downloads
Aufrufe
Aufrufe insgesamt
3.274
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
633
Aktionen
Geteilt
0
Downloads
4
Kommentare
0
Gefällt mir
0
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

Hubot: a look inside our robot friend

  1. 1. HUBOTA LOOK INSIDE OUR ROBOT FRIEND
  2. 2. 1. Setting Up Hubot2. Coffeescript Primer3. Hubot Overview4. APIs
  3. 3. (disclaimer: this assumes OSX. commands should translate easily to windows and linux.)
  4. 4. PREREQUISITES Install Node be isalnd rw ntl oe Install and run Redisadd / s / o a / h r / p / i to your path urlclsaenmbn Install Hubot nmisal- cfe-cit p ntl g ofesrp nmisal- hbt p ntl g uo An Heroku account is suggested.
  5. 5. FIND A NICE HOME c to directory of choice drun h b t - a r o to generate a boilerplate uo c ibt c aro d ibt cmd+ bnhbt ho x i/uo
  6. 6. HELLO WORLD run b n h b t i/uotype h b t p n and hit enter uo ig
  7. 7. A BRIEF DIVERSION INTO COFFEESCRIPT
  8. 8. itoesg =(sr -nrMsae ue) > i ue?nm?adue?hby f sr.ae n sr.ob? "el,Ia #rsos.ae,"+ hlo m {epnenm} " #rsos.ob}s. a {epnehbyit" es le msae="laetl m mr aotyusl. esg Pes el e oe bu oref" msae esgm = e nm:"ak ae Jc" hby "uo crto" ob: Hbt uaincnoelgitoesg(eosl.o nrMsaem)#el,Ia Jc,aHbtcrtoithlo m ak uo uains
  9. 9. HUBOT STRUCTUREP o f l (Heroku startup script) rcieRAM.d EDEmb n (contains hubot executable) i/e t r a - c i t . s n(list of packages from npm) xenlsrpsjoh b t s r p s j o (list of packages from hubot- uo-cit.snscripts)p c a e j o (node package manager akg.snmetainformation)s r p s (custom hubot script directory) cit/
  10. 10. A HUBOT SCRIPT EXAMPLE CREATE AND EDITSRPSGOBECFECIT/ODY.OFE
  11. 11. gobe =[ odys "y,{ae., Be nm}" "ae,{ae., Ltr nm}" "aecr,{ae. Tk ae nm}"]gobe=(ae -ody nm) > idx=pren(ahrno( *gobe.egh ne asItMt.adm) odyslnt) msae=gobe[ne] esg odysidx msaerpae/nm},nm) esg.elc({ae/ ae;mdl.xot =(oo)-oueeprs rbt > rbtha /beltr,(*/,(s)- oo.er (y|ae)?s.)i mg > i rbtnm.ooeCs( = mgmth2.ooeCs( f oo.aetLwrae) = s.ac[]tLwrae) beesg =gobemgmsaeue.ae yMsae ody(s.esg.srnm) mgsn(yMsae s.edbeesg)
  12. 12. run b n h b tagain i/uosay g o b e H b t ody uosay l t r H b t ae, uo
  13. 13. HUBOT-SCRIPTS GITHUB.COM/GITHUB/HUBOT-SCRIPTShubot will automatically download and keep up-to-date any hubot-scripts you add
  14. 14. copy the dependencies from the hubot-script into your pcaejo akg.sn from clark.coffee : #Dsrpin ecito: # Nn oe # #Dpnece: eednis # "lr" ".." cak: 005 # #Cniuain ofgrto: # Nn oe # #Cmad: omns # hbtcak<aa -bidsakie oto dt uo lr dt> ul prlns u f aa # #Ato: uhr # aakiid jcsfe
  15. 15. edit h b t s r p s j o uo-cit.sn add " l r . o f e cakcfe" run b n h b t i/uosay h b t c a k 1 2 3 4 5 uo lr
  16. 16. HUBOT PERSISTANCE simple storage through h b t b a n uo.ri overloaded by redis-brain, mongo-brain, etc.(you can find these in hubot-scripts or write your own)
  17. 17. You can save any arbitrary data in the brain.#yumywn t wi utltebanhsbe iiilzd o a at o at ni h ri a en ntaie#adteei adtbs cneto n hr s aaae oncinrbtbano odd,-oo.ri.n lae > rbtbanlsAcse =nwDt( oo.ri.atcesd e ae) rbtbansaul =1 oo.ri.egls 2 rbtbanfoes={pnis tu,dfois fle} oo.ri.lwr ase: re afdl: as #hbtbanrn o eet uo ri us n vns rbtbanei ae oo.ri.mt sv
  18. 18. HUBOT HTTP LISTENER CREATE AND EDIT SRPSSYCFE CIT/A.OFE
  19. 19. qeytig=rqieursrnursrn eur(qeytig)mdl.xot =(oo)-oueeprs rbt > rbtrue.e "hbtsy,(e,rs - oo.otrgt /uo/a" rq e) > qey=qeytigprerq_asdr.ur) ur ursrn.as(e.preUlqey msae=qeymsae esg ur.esg ue ={ sr } ue.om=qeyro i qeyro srro ur.om f ur.om rbtsn(sr msae oo.edue, esg) rsed"ad#msae" e.n si {esg}
  20. 20. edit p c a e j o to include akg.sn" u r s r n " " = 0 1 0 in the dependencies qeytig: > .." run n m i s a l p ntl run b n h b t i/uo visit l c l o t 8 8 / a ? e s g = e l oahs:00symsaehlo
  21. 21. DEPLOYMENT99 times out of 100, youll probably just deploy to Heroku h b t - creates a Heroku P o f l for you uo c rcie run H r k c e t eou rae deploy with g t p s h r k m s e i uh eou atr start with h r k p : c l w b 1 eou ssae e= (youll only have to run p : c l this the first time) ssae
  22. 22. CHAT ADAPTERSHubot ships with a Campfire adapter. You can get more from hubot-scripts. Assuming Heroku deployment, run Hrk cni:d eou ofgad HBTCMFR_OE=ert UO_APIETKNsce HBTCMFR_OM=2,5 UO_APIEROS1346 HBTCMFR_CON=hbt UO_APIEACUT"uo"

×