Page 1 of 1

Twitter updates

Posted: Wed Sep 29, 2010 1:19 pm
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?

Re: Twitter updates

Posted: Wed Sep 29, 2010 2:38 pm
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...

Re: Twitter updates

Posted: Wed Sep 29, 2010 2:45 pm
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 :)

Re: Twitter updates

Posted: Wed Sep 29, 2010 8:23 pm
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

Re: Twitter updates

Posted: Wed Sep 29, 2010 8:28 pm
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 :)