Twitter Scripts for messaging schema

No replies
kevin9
Offline
Lincolnshire, United Kingdom
Joined: 24 May 2010

Here are some lua scripts which pick up xAP display messages and forward them to twitter

The message schema being monitored are Message.Display and xAP-OSD.Display which are used in my setup for caller display messages and other alerts.

I should explain my twitter setup. My house has a separate twitter account, 'kevins house', to my personal account and it is this account which the HAH twitter connector is configured and authorized for. 'kevinshouse' is a protected twitter account so its messages are not publicly available and only people I authorise can see the messages. Obviously, my personal account is authorised.

Although the HAH Twitter connector can action  commands, I currently don't plan to use this feature.

If you don't have twitter on your phone, you can setup your account so  that you get a text message (mobile notification) when a tweet from the 'house' account arrives

My primary usage will be for the Caller ID messages from xAP Switchboard, and it was this script, TweetPhoneApplet.lua, which I made first. It can send messages using a number of schema, I chose to use xAP-OSD.Display, a typical message looks like

xap-header
    {
    v=12
    hop=1
    uid=FF111300
    Class=xAP-OSD.display
    Source=mi4.switchboard.BLACK1
    }
    Display.SLIMP3
    {
    Line1=Incoming  Call : Kevin
    Line2=Mobile Telephone, 07871 700000
    Duration=20
    Brightness=Brightest
}

this results in my account getting a tweet like this

This script specificaly checks for xAP-OSD.display messages from mi4.switchboard.BLACK1 (vendor.application.pcname)

To ensure that two consecutive calls from the same number are recognised by twitter (it won't repeat identical messages), each message is prefixed by the time. I have also added a  suffix message, you have to do the tone singing in your head....

Recognising that not many of you will have xAP Switchboard, the second script, TweetOSDApplet.lua, is more general and will tweet any xAP-OSD.display message, without the suffix.

The third script,TweetMessageApplet.lua, deals with message.display schema messages

Tweets are limited to 140 characters. I have not investigated/implemented how to limit the message length coming from these scripts. If the message exceeds 140 characters then twitter, if not HAH Twitter, will not pass them on

Note that my HAH is configured for an 'Instance' of '1', so you may want to change the references in the scripts of target=dbzoo.livebox.1.Twitter and dbzoo.livebox.1.Plugboard to match your setup

Each of the scripts includes example xAP messages in the header comments.

kevint

 

AttachmentSize
TweetPhoneApplet.lua1.12 KB
TweetOSDApplet.lua1.36 KB
TweetMessageApplet.lua990 bytes
Hardware Info