No worries, in that case its actually easier than you think (and that I
thought). Don't worry about the quotes or escaping stuff just do the
following:
Macro:
RN /home/user/twitter.sh Super Awesome Show!
Script:
#!/bin/bash
echo "This will give me all the args: "$@ >> /home/user/testarg.log
echo "So will this: "$* >> /home/user/testarg.log
echo "This only the first Arg: "$1 >> /home/user/testarg.log
echo "This should error or do nothing: "$9 >> /home/user/testarg.log
Wayne Merricks
The Voice Asia
On 30/08/12 12:31, Jay Eames wrote:
Hi Wayne,
Thanks for the answer.
I had originally thought of using a wrapper script, hence why If you
see in my original question I stated that it didn't seem that you can
easily pass arguments - what I should have specified is that this is
due to not being able to use quotes in the Macro entry. The
documentation is a little less than clear on this area. My bad on the
communication!
Cheers,
Jay
On 30 August 2012 12:18, Wayne Merricks
<[email protected]
<mailto:[email protected]>> wrote:
You're half way there already, I assume you're using a bash
script via cron. You can pass command line arguments to the script:
http://how-to.wikia.com/wiki/How_to_read_command_line_arguments_in_a_bash_script
E.g.
RN twitter.sh "The Awesome Show"! (you might have to space escape
the arguments e.g. The\ Awesome\ Show instead of speech marks)
Then in the bash script you can reference the arguments by $1, $2,
$3 etc (depending on how many arguments there are).
So assuming to tweet you call tweetme $MYACCOUNT $MESSAGE you'd do:
tweetme $MYACCOUNT $1 (which would be replaced with The Awesome
Show in this example).
Regards,
Wayne Merricks
The Voice Asia
On 30/08/12 09:24, Jay Eames wrote:
Hi guys,
As a question, has anyone come up with a way of tweeting from a
macro?
What I'm looking at doing is a "now on air" tweet at the change
of each show. I currently do this off of a cron job, which works
but is not optimal. What I would prefer to do is to fire this
from the log, so that if there is a change to the schedule, it
would automatically be picked up from the log rather than having
to update the cron script each time.
I've looked into the RN Macro, but that doesn't easily allow you
to specify the contents of the tweet in the macro from what I can
see.
Jay
--
There are 2 kinds of people in the world; Those who can
extrapolate from incomplete data
_______________________________________________
Rivendell-dev mailing list
[email protected]
<mailto:[email protected]>
http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
------------------------------------------------------------------------
Scanned by *MailMarshal*
**
------------------------------------------------------------------------
------------------------------------------------------------------------
*Attention: *
The information contained in this message is confidential and
intended for the addressee(s) only. If you have received this
message in error or there are any problems, please notify the
originator immediately. The
unauthorised use, disclosure, copying or alteration of this
message is strictly forbidden. Christian Vision or any of its
subsidiaries will not be liable for direct, special, indirect or
consequential damages arising from alteration of the contents of
this message by a third party or as a result of any virus being
passed on. Please note that we reserve the right to monitor and
read any e-mails sent or received by the company under the
Telecommunications (Lawful Business Practice) (Interception of
Communications) Regulation 2000. Christian Vision is registered in
England as a limited company 2842414 and
as a charity 1031031
------------------------------------------------------------------------
_______________________________________________
Rivendell-dev mailing list
[email protected]
<mailto:[email protected]>
http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
--
There are 2 kinds of people in the world; Those who can
extrapolate from incomplete data
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
#######################
Scanned by MailMarshal
#######################
############
Attention:
The information contained in this message is confidential and intended
for the addressee(s) only. If you have received this message in error
or there are any problems, please notify the originator immediately.
The unauthorised use, disclosure, copying or alteration of this message
is strictly forbidden. Christian Vision or any of its subsidiaries will
not be liable for direct, special, indirect or consequential damages
arising from alteration of the contents of this message by a third party
or as a result of any virus being passed on. Please note that we reserve
the right to monitor and read any e-mails sent or received by the
company under the Telecommunications (Lawful Business Practice)
(Interception of Communications) Regulation 2000. Christian Vision is
registered in England as a limited company 2842414 and as a charity
1031031
############
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev