Twitter updates

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
j.hoekstra
Member
Member
Posts: 255
Joined: Thu Jun 25, 2009 2:09 pm
Location: Enschede, The Netherlands

Twitter updates

Post by j.hoekstra »

I've been able to get twitter working following the how-to on the wiki. I can post on twitter whenever something happens, however twitter checks if the message is the same as the last few and if it is, blocks the message.
I've managed to add a date to the tweets by changing line 22 in the twitter module from:

Code: Select all

hTweet = SHELL "echo '" & sMessage & "'|bti --debug" FOR READ AS "Tweet"
to

Code: Select all

hTweet = SHELL "echo '" & Main.dTime & ": " & sMessage & "'|bti --debug" FOR READ AS "Tweet"
Which works, however I'm picky and would like to strip ms and the current date, so instead of this:

09/29/2010 12:55:22.382: test time
I would like this:
12:55:22: test time

I tried with both Main.dTime and Main.dTime_Now, they both use the same format however.
Any pointers?
dali
Starting Member
Starting Member
Posts: 46
Joined: Mon Nov 09, 2009 10:02 am
Location: Habo, Sweden
Contact:

Re: Twitter updates

Post by dali »

Try this:

Code: Select all

hTweet = SHELL "echo '" & Hour(Main.dTime) & ":" & Minute(Main.dTime) & ":" & Second(Main.dTime) & ": " & sMessage & "'|bti --debug" FOR READ AS "Tweet"
Should work...
j.hoekstra
Member
Member
Posts: 255
Joined: Thu Jun 25, 2009 2:09 pm
Location: Enschede, The Netherlands

Re: Twitter updates

Post by j.hoekstra »

I was looking at that already based on stuff going on the main-section.
It works, thanks :)

EDIT: Sent it as a patch on trac :)
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Twitter updates

Post by RDNZL »

Ok thanks.

I have made it optional in the current development version.
Why the spaces between the digits?
To get a time in the same format this will do too:

Code: Select all

Format$(Now(), "hh:nn:ss ") & sMessage
Regards, Ron.
j.hoekstra
Member
Member
Posts: 255
Joined: Thu Jun 25, 2009 2:09 pm
Location: Enschede, The Netherlands

Re: Twitter updates

Post by j.hoekstra »

Because I'm no programmer ;)
I like the format you have on twitter, so filling up wit leading zero's where-ever needed.
It's to make twitter not discard my updates ;)

EDIT: Tried your solution, however, then running domotiga failed. I'll just wait for the next release :)
Post Reply

Return to “DomotiGa Forum”