-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to p4twitter!
p4twitter is a command-line utility that will publish the description of your Perforce commits to Twitter.
Because tweets are text-based posts of up to 140 bytes in length, Twitter is an excellent channel to publish your commits to your target audience.
Click here to download p4twitter (version 2.0 released on October 12, 2010)
Perforce is a version control system.
p4twitter is Windows-only.
Before p4twitter can "tweet" on your behalf, you need to authorize it (basically, you will need to allow p4twitter to access your Twitter account):
p4twitter /authorize
- a web browser will open automatically
- enter your Twitter username and password
- Twitter will "respond" with a PIN
- enter this PIN into the p4twitter console
- p4twitter will provide you with your OAuth Access Token (see below)
Note: p4twitter /authorize
is a one-time procedure. If successful, it will provide you with your OAuth Access Token (see below) and you do not have to execute this again (unless you need to authorize another Twitter account).
p4twitter expects the following command-line parameters:
oauth_token = your OAuth Access Token
oauth_token_secret = your OAuth Access Token Secret
p4user = your Perforce username (probably Administrator)
p4passwd = your Perforce password (probably the Administrator password)
In addition to the above, p4twitter expects a command-line parameter named changelist
, but this is provided by the Perforce server itself via the %changelist%
variable:
p4twitter changelist=%changelist%
- Unzip p4twitter.zip to your Perforce server directory (probably C:\Program Files\Perforce)
- Authorize p4twitter (via the
/authorize
command-line argument) so that p4twitter can access your Twitter account and "tweet" on your behalf. - Create a new Perforce trigger (click here for more info on Perforce triggers).
We're not going to repeat everything about Perforce triggers here, but you easily create a Perforce trigger via the p4 triggers
command. Here's an example:
p4twitter change-commit //depot/... "p4twitter.exe oauth_token=*** oauth_token_secret=*** p4user=*** p4passwd=*** changelist=%changelist%"
This example above breaks down to this:
p4twitter
the name of the trigger.
change-commit
trigger type.
change-commit
is a trigger that will execute after your commit.
//depot/...
a file pattern in depot syntax. when a dev commits a change that contains any files that match this file pattern, this trigger is executed.
"p4twitter.exe oauth_token=*** oauth_token_secret=*** p4user=*** p4passwd=*** changelist=%changelist%"
the command for the Perforce server to run. must be quoted. please make sure to include all the command-line parameters and the
%changelist%
variable.
Note: p4twitter will ALWAYS return an exit status of 0 (zero), even if sending the description of your commit to Twitter fails for whatever reason. We're doing this because your commit should ALWAYS succeed.
Yes, p4twitter is freeware but unsupported. Use at your own risc.
Copyright © 2010 Stefan van As. All rights reserved.
p4twitter is unsupported, but you're welcome to send us your comments.