Twitter updates

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Twitter updates

Postby j.hoekstra » Wed Sep 29, 2010 1:19 pm

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?
j.hoekstra
Member
Member
 
Posts: 243
Joined: June 2009
Location: Enschede, The Netherlands

Re: Twitter updates

Postby dali » Wed Sep 29, 2010 2:38 pm

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...
dali
Starting Member
Starting Member
 
Posts: 46
Joined: November 2009
Location: Habo, Sweden

Re: Twitter updates

Postby j.hoekstra » Wed Sep 29, 2010 2:45 pm

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 :)
j.hoekstra
Member
Member
 
Posts: 243
Joined: June 2009
Location: Enschede, The Netherlands

Re: Twitter updates

Postby RDNZL » Wed Sep 29, 2010 8:23 pm

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.
http://domotiga.nl - open source home automation software for Linux.
User avatar
RDNZL
Forum Moderator
Forum Moderator
 
Posts: 919
Joined: September 2006
Location: Dordrecht, The Netherlands

Re: Twitter updates

Postby j.hoekstra » Wed Sep 29, 2010 8:28 pm

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 :)
j.hoekstra
Member
Member
 
Posts: 243
Joined: June 2009
Location: Enschede, The Netherlands


Return to DomotiGa Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron