Permalink
Browse files

implement

  • Loading branch information...
1 parent 15dd0c7 commit 60cd541a2bf8f46b04b1592941f952070961facf @yappo committed Feb 9, 2011
Showing with 467 additions and 47 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 .shipit
  3. +8 −6 Makefile.PL
  4. +88 −3 README
  5. +101 −3 README.mkdn
  6. +214 −0 lib/ShipIt/Step/Facebook.pm
  7. +0 −32 lib/ShipIt/Step/Faebook.pm
  8. +1 −1 t/00_compile.t
  9. +41 −0 tools/init.pl
  10. +12 −1 xt/01_podspell.t
View
@@ -1,5 +1,6 @@
cover_db
META.yml
+MYMETA.yml
Makefile
blib
inc
View
@@ -1 +1 @@
-steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN
+steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN, Facebook
View
@@ -1,16 +1,18 @@
use inc::Module::Install;
-name 'ShipIt-Step-Faebook';
-all_from 'lib/ShipIt/Step/Faebook.pm';
-readme_from 'lib/ShipIt/Step/Faebook.pm';
-readme_markdown_from 'lib/ShipIt/Step/Faebook.pm';
+name 'ShipIt-Step-Facebook';
+all_from 'lib/ShipIt/Step/Facebook.pm';
+readme_from 'lib/ShipIt/Step/Facebook.pm';
+readme_markdown_from 'lib/ShipIt/Step/Facebook.pm';
githubmeta;
-# requires '';
+requires 'YAML';
+requires 'LWP::UserAgent';
+requires 'HTTP::Request::Common';
+requires 'ShipIt';
tests 't/*.t';
author_tests 'xt';
build_requires 'Test::More';
auto_set_repository;
-auto_include;
WriteAll;
View
91 README
@@ -1,16 +1,101 @@
NAME
- ShipIt::Step::Faebook -
+ ShipIt::Step::Facebook - ShipIt step to announce the upload on Facebook
SYNOPSIS
- use ShipIt::Step::Faebook;
+ None.
DESCRIPTION
- ShipIt::Step::Faebook is
+ This ShipIt step announces the upload to Facebook.
+
+ To use it, just list it in your ".shipit" file. You might want to use it
+ after the "UploadCPAN" step, as it is not a good idea to announce the
+ upload before it has gone through - something might go wrong with the
+ upload.
+
+ If this step fails - maybe Facebook is down - a warning is issued, but
+ the shipit process doesn't die. This is because you might have uploaded
+ the distribution to CPAN already, and it would be a shame for the whole
+ process to die just because you're not able to facebook.
+
+GET FACEBOOK ACCESS_TOKEN AND STORE
+ run "tools/init.pl" in this distribution.
+
+ Please follow the message of a script.
+
+CONFIGURATION
+ In the ".shipit" file:
+
+ facebook.config = ~/.shipit.facebook
+ facebook.distname = Foo-Bar
+ facebook.message = shipped %d %v - soon at %f
+ facebook.target = me
+
+ You can define three configuration values for this step:
+
+ The Variables is not mandatory.
+
+ facebook.config
+ This is the location of the file that contains the Facebook
+ access_token and Wall target_id in YAML style. The first tilde is
+ expanded to the user's home directory. An example file could look
+ like this:
+
+ access_token: ACCESS_TOKEN
+ target: me
+
+ The access_token is mandatory.
+
+ default '~/.shipit.facebook'
+
+ facebook.distname
+ This variable is optional; it is the distribution's name. If the
+ variable is not defined, the step will try to read the distribution
+ name from the META.yml file.
+
+ facebook.message
+ This variable is optional; it is the message to send to Facebook.
+ You can use placeholders, which will be expanded. If the variable is
+ not defined, this default message will be used:
+
+ shipped %d %v - soon at %f
+
+ The following placeholders are recognized:
+
+ %d Will be expanded to the distribution name that you defined in
+ "facebook.distname".
+
+ %u Will be expanded to the distribution's CPAN URL - if the
+ distribution name is "Foo-Bar", for example, the URL will be
+ "http://search.cpan.org/dist/Foo-Bar".
+
+ %f Will be expanded to the distribution's FrePAN URL - if the
+ distribution name is "Foo-Bar", for example, the URL will be
+ "http://frepan.org/dist/Foo-Bar".
+
+ %v Will be expanded to the version of the distribution you're
+ shipping.
+
+ %% Will result in a percent sign.
+
+ facebook.target
+ you can select Wall page in message write.
+
+ When you want to carry out POST to Wall of
+ "http://www.facebook.com/kazuhiro.osawa":
+
+ facebook.target = kazuhiro.osawa
+
+ When you want to carry out POST to Wall of
+ "http://www.facebook.com/pages/Yappo/200453809970361":
+
+ facebook.target = 200453809970361
AUTHOR
Kazuhiro Osawa <yappo {at} shibuya {dot} pl>
SEE ALSO
+ many code takes from ShipIt::Step::Twitter
+
LICENSE
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
View
@@ -1,21 +1,119 @@
# NAME
-ShipIt::Step::Faebook -
+ShipIt::Step::Facebook - ShipIt step to announce the upload on Facebook
# SYNOPSIS
- use ShipIt::Step::Faebook;
+None.
# DESCRIPTION
-ShipIt::Step::Faebook is
+This [ShipIt](http://search.cpan.org/perldoc?ShipIt) step announces the upload to Facebook.
+
+To use it, just list it in your `.shipit` file. You might want to use it
+after the `UploadCPAN` step, as it is not a good idea to announce the
+upload before it has gone through - something might go wrong with the upload.
+
+If this step fails - maybe Facebook is down - a warning is issued, but the
+shipit process doesn't die. This is because you might have uploaded the
+distribution to CPAN already, and it would be a shame for the whole process to
+die just because you're not able to facebook.
+
+# GET FACEBOOK ACCESS_TOKEN AND STORE
+
+run `tools/init.pl` in this distribution.
+
+Please follow the message of a script.
+
+# CONFIGURATION
+
+In the `.shipit` file:
+
+ facebook.config = ~/.shipit.facebook
+ facebook.distname = Foo-Bar
+ facebook.message = shipped %d %v - soon at %f
+ facebook.target = me
+
+You can define three configuration values for this step:
+
+The Variables is not mandatory.
+
+- facebook.config
+
+This is the location of the file that contains the Facebook access_token and
+Wall target_id in YAML style. The first tilde is expanded to the user's home
+directory. An example file could look like this:
+
+ access_token: ACCESS_TOKEN
+ target: me
+
+The access_token is mandatory.
+
+
+
+default '~/.shipit.facebook'
+
+- facebook.distname
+
+This variable is optional; it is the distribution's name. If the variable is
+not defined, the step will try to read the distribution name from the META.yml
+file.
+
+- facebook.message
+
+This variable is optional; it is the message to send to Facebook. You can use
+placeholders, which will be expanded. If the variable is not defined, this
+default message will be used:
+
+ shipped %d %v - soon at %f
+
+The following placeholders are recognized:
+
+ - %d
+
+ Will be expanded to the distribution name that you defined in
+ `facebook.distname`.
+
+ - %u
+
+ Will be expanded to the distribution's CPAN URL - if the distribution name is
+ `Foo-Bar`, for example, the URL will be
+ `http://search.cpan.org/dist/Foo-Bar`.
+
+ - %f
+
+ Will be expanded to the distribution's FrePAN URL - if the distribution name is
+ `Foo-Bar`, for example, the URL will be
+ `http://frepan.org/dist/Foo-Bar`.
+
+ - %v
+
+ Will be expanded to the version of the distribution you're shipping.
+
+ - %%
+
+ Will result in a percent sign.
+
+- facebook.target
+
+you can select Wall page in message write.
+
+When you want to carry out POST to Wall of `http://www.facebook.com/kazuhiro.osawa`:
+
+ facebook.target = kazuhiro.osawa
+
+When you want to carry out POST to Wall of `http://www.facebook.com/pages/Yappo/200453809970361`:
+
+ facebook.target = 200453809970361
# AUTHOR
Kazuhiro Osawa <yappo {at} shibuya {dot} pl>
# SEE ALSO
+many code takes from [ShipIt::Step::Twitter](http://search.cpan.org/perldoc?ShipIt::Step::Twitter)
+
# LICENSE
This library is free software; you can redistribute it and/or modify
Oops, something went wrong.

0 comments on commit 60cd541

Please sign in to comment.