Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
livebox:twitter [2012/01/27 20:29] – [Sending tweets] kevint | livebox:twitter [2012/05/29 10:55] – [alias interpreter] brett | ||
---|---|---|---|
Line 11: | Line 11: | ||
Authentication is done via [[http:// | Authentication is done via [[http:// | ||
+ | |||
+ | <note tip>If you are struggling to get OAUTH to work on when using IE8, try using another browser, eg Chrome</ | ||
{{: | {{: | ||
Line 30: | 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. | ||
+ | < | ||
+ | cp / | ||
+ | / | ||
+ | </ | ||
===== Sending tweets ===== | ===== Sending tweets ===== | ||
Line 53: | 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 | ||
</ | </ | ||