Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
livebox:twitter [2012/03/16 17:07] – [xAP Twitter] brett | livebox:twitter [2012/05/15 21:10] – [xAP Twitter] brett | ||
---|---|---|---|
Line 32: | Line 32: | ||
</ | </ | ||
- | The commands you enter resolve the same way as the Google Calendar component (//See [[hah# | + | The commands you enter resolve the same way as the Google Calendar component (//See [[google_calendar# |
+ | |||
+ | {{: | ||
<note tip>To get up and running quickly you can use the sample provided on the box as a starting point. | <note tip>To get up and running quickly you can use the sample provided on the box as a starting point. | ||
Line 61: | Line 63: | ||
text=Hello World | text=Hello World | ||
} | } | ||
+ | </ | ||
+ | |||
+ | ===== alias interpreter ===== | ||
+ | |||
+ | An alias engine is supplied on the HAH as a sample to install this | ||
+ | < | ||
+ | # cp / | ||
+ | </ | ||
+ | |||
+ | This is how the default alias engine looks - You'll want to edit this as you add twitter and google calender command shortcuts. | ||
+ | <code lua> | ||
+ | --[[ | ||
+ | Alias interpreter | ||
+ | |||
+ | Use to perform actions based on xAP alias class messages emitted by | ||
+ | both xap-twitter and xap-googlecal | ||
+ | --]] | ||
+ | |||
+ | module(..., | ||
+ | |||
+ | require(" | ||
+ | require(" | ||
+ | require(" | ||
+ | rex = require(" | ||
+ | |||
+ | info={ | ||
+ | | ||
+ | } | ||
+ | |||
+ | pat={ | ||
+ | [rex.new(" | ||
+ | [rex.new(" | ||
+ | [rex.new(" | ||
+ | } | ||
+ | |||
+ | function tweet(m) | ||
+ | local msg = unpack(m) | ||
+ | bsc.sendText(" | ||
+ | end | ||
+ | |||
+ | function rfRelayCmd(t) | ||
+ | local addr1, | ||
+ | bsc.sendState(string.format(" | ||
+ | end | ||
+ | |||
+ | function aliasEngine(frame) | ||
+ | local alias = frame: | ||
+ | for r,f in pairs(pat) do | ||
+ | if type(r) == " | ||
+ | if r == alias then | ||
+ | f() | ||
+ | end | ||
+ | else | ||
+ | p={r: | ||
+ | if #p > 0 then | ||
+ | f(p) | ||
+ | end | ||
+ | end | ||
+ | end | ||
+ | end | ||
+ | |||
+ | function init() | ||
+ | local f = xap.Filter() | ||
+ | f: | ||
+ | f: | ||
+ | f: | ||
+ | end | ||
</ | </ | ||