]>
iEval git - webservice-foaas.git/blob - lib/WebService/FOAAS.pm
e7cb714ba5925f1fd05bebc7c7462550a62ac8ad
1 package WebService
::FOAAS
;
7 WebService::FOAAS - API client for https://foaas.com
11 use WebService::FOAAS;
12 print foaas_too 'MGV'; # Thanks, fuck you too. - MGV
13 print foaas_cool 'MGV', {shoutcloud => 1}; # COOL STORY, BRO. - MGV
17 FOAAS (Fuck Off As A Service) provides a modern, RESTful, scalable
18 solution to the common problem of telling people to fuck off.
20 C<WebService::FOAAS> is an API client for FOAAS. It provides a series
21 of methods for getting data from the service.
23 The methods are listed below, and documented on the FOAAS webpage.
24 Each method comes under two names, C<thing> and C<foaas_thing>.
25 They are identical in function, but only C<foaas_thing> is exported by
26 default while C<thing> is only exported on request.
37 use parent qw
/Exporter/;
39 our $VERSION = '0.002';
40 our $BASE = 'https://foaas.com';
42 our $ht = HTTP
::Tiny
->new;
47 if (ref $args[$#args] eq 'HASH') {
48 my $query = pop @args;
50 my $key = uri_escape_utf8
$_;
51 my $val = uri_escape_utf8
$query->{$_};
52 push @query, "$key=$val";
56 my $query = @query ?
'?'.(join '&', @query) : '';
57 my $path = join '/', '', @args;
58 my $final_url = $BASE.$path.$query;
60 my $result = $ht->get($final_url, {headers
=> {Accept
=> 'text/plain'}});
61 die $result->{reason
} unless $result->{success
};
65 ### Start of code generated by WebService::FOAAS::Codegen->run
67 =head1 AVAILABLE METHODS
71 =item foaas_anyway $company, $from
76 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
80 BEGIN { *anyway
= \
&foaas_anyway
}
82 =item foaas_asshole $from
87 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
88 request
'asshole', @_;
91 BEGIN { *asshole
= \
&foaas_asshole
}
93 =item foaas_awesome $from
98 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
99 request
'awesome', @_;
102 BEGIN { *awesome
= \
&foaas_awesome
}
104 =item foaas_back $name, $from
109 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
113 BEGIN { *back
= \
&foaas_back
}
115 =item foaas_bag $from
120 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
124 BEGIN { *bag
= \
&foaas_bag
}
126 =item foaas_ballmer $name, $company, $from
131 die "Expected 3 arguments" unless @_ == 3 || @_ == 4;
132 request
'ballmer', @_;
135 BEGIN { *ballmer
= \
&foaas_ballmer
}
137 =item foaas_bday $name, $from
142 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
146 BEGIN { *bday
= \
&foaas_bday
}
148 =item foaas_because $from
153 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
154 request
'because', @_;
157 BEGIN { *because
= \
&foaas_because
}
159 =item foaas_blackadder $name, $from
163 sub foaas_blackadder
{
164 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
165 request
'blackadder', @_;
168 BEGIN { *blackadder
= \
&foaas_blackadder
}
170 =item foaas_bm $name, $from
175 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
179 BEGIN { *bm
= \
&foaas_bm
}
181 =item foaas_bucket $from
186 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
187 request
'bucket', @_;
190 BEGIN { *bucket
= \
&foaas_bucket
}
192 =item foaas_bus $name, $from
197 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
201 BEGIN { *bus
= \
&foaas_bus
}
203 =item foaas_bye $from
208 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
212 BEGIN { *bye
= \
&foaas_bye
}
214 =item foaas_caniuse $tool, $from
219 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
220 request
'caniuse', @_;
223 BEGIN { *caniuse
= \
&foaas_caniuse
}
225 =item foaas_chainsaw $name, $from
230 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
231 request
'chainsaw', @_;
234 BEGIN { *chainsaw
= \
&foaas_chainsaw
}
236 =item foaas_cocksplat $name, $from
240 sub foaas_cocksplat
{
241 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
242 request
'cocksplat', @_;
245 BEGIN { *cocksplat
= \
&foaas_cocksplat
}
247 =item foaas_cool $from
252 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
256 BEGIN { *cool
= \
&foaas_cool
}
258 =item foaas_cup $from
263 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
267 BEGIN { *cup
= \
&foaas_cup
}
269 =item foaas_dalton $name, $from
274 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
275 request
'dalton', @_;
278 BEGIN { *dalton
= \
&foaas_dalton
}
280 =item foaas_deraadt $name, $from
285 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
286 request
'deraadt', @_;
289 BEGIN { *deraadt
= \
&foaas_deraadt
}
291 =item foaas_diabetes $from
296 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
297 request
'diabetes', @_;
300 BEGIN { *diabetes
= \
&foaas_diabetes
}
302 =item foaas_donut $name, $from
307 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
311 BEGIN { *donut
= \
&foaas_donut
}
313 =item foaas_dosomething $do, $something, $from
317 sub foaas_dosomething
{
318 die "Expected 3 arguments" unless @_ == 3 || @_ == 4;
319 request
'dosomething', @_;
322 BEGIN { *dosomething
= \
&foaas_dosomething
}
324 =item foaas_equity $name, $from
329 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
330 request
'equity', @_;
333 BEGIN { *equity
= \
&foaas_equity
}
335 =item foaas_everyone $from
340 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
341 request
'everyone', @_;
344 BEGIN { *everyone
= \
&foaas_everyone
}
346 =item foaas_everything $from
350 sub foaas_everything
{
351 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
352 request
'everything', @_;
355 BEGIN { *everything
= \
&foaas_everything
}
357 =item foaas_family $from
362 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
363 request
'family', @_;
366 BEGIN { *family
= \
&foaas_family
}
368 =item foaas_fascinating $from
372 sub foaas_fascinating
{
373 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
374 request
'fascinating', @_;
377 BEGIN { *fascinating
= \
&foaas_fascinating
}
379 =item foaas_field $name, $from, $reference
384 die "Expected 3 arguments" unless @_ == 3 || @_ == 4;
388 BEGIN { *field
= \
&foaas_field
}
390 =item foaas_flying $from
395 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
396 request
'flying', @_;
399 BEGIN { *flying
= \
&foaas_flying
}
401 =item foaas_fyyff $from
406 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
410 BEGIN { *fyyff
= \
&foaas_fyyff
}
412 =item foaas_gfy $name, $from
417 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
421 BEGIN { *gfy
= \
&foaas_gfy
}
423 =item foaas_give $from
428 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
432 BEGIN { *give
= \
&foaas_give
}
434 =item foaas_greed $noun, $from
439 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
443 BEGIN { *greed
= \
&foaas_greed
}
445 =item foaas_horse $from
450 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
454 BEGIN { *horse
= \
&foaas_horse
}
456 =item foaas_immensity $from
460 sub foaas_immensity
{
461 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
462 request
'immensity', @_;
465 BEGIN { *immensity
= \
&foaas_immensity
}
467 =item foaas_ing $name, $from
472 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
476 BEGIN { *ing
= \
&foaas_ing
}
478 =item foaas_keep $name, $from
483 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
487 BEGIN { *keep
= \
&foaas_keep
}
489 =item foaas_keepcalm $reaction, $from
494 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
495 request
'keepcalm', @_;
498 BEGIN { *keepcalm
= \
&foaas_keepcalm
}
500 =item foaas_king $name, $from
505 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
509 BEGIN { *king
= \
&foaas_king
}
511 =item foaas_life $from
516 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
520 BEGIN { *life
= \
&foaas_life
}
522 =item foaas_linus $name, $from
527 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
531 BEGIN { *linus
= \
&foaas_linus
}
533 =item foaas_look $name, $from
538 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
542 BEGIN { *look
= \
&foaas_look
}
544 =item foaas_looking $from
549 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
550 request
'looking', @_;
553 BEGIN { *looking
= \
&foaas_looking
}
555 =item foaas_madison $name, $from
560 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
561 request
'madison', @_;
564 BEGIN { *madison
= \
&foaas_madison
}
566 =item foaas_maybe $from
571 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
575 BEGIN { *maybe
= \
&foaas_maybe
}
582 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
586 BEGIN { *me
= \
&foaas_me
}
588 =item foaas_mornin $from
593 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
594 request
'mornin', @_;
597 BEGIN { *mornin
= \
&foaas_mornin
}
604 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
608 BEGIN { *no = \
&foaas_no
}
610 =item foaas_nugget $name, $from
615 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
616 request
'nugget', @_;
619 BEGIN { *nugget
= \
&foaas_nugget
}
621 =item foaas_off $name, $from
626 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
630 BEGIN { *off
= \
&foaas_off
}
632 =item foaas_off_with $behavior, $from
637 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
638 request
'off_with', @_;
641 BEGIN { *off_with
= \
&foaas_off_with
}
643 =item foaas_outside $name, $from
648 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
649 request
'outside', @_;
652 BEGIN { *outside
= \
&foaas_outside
}
654 =item foaas_particular $thing, $from
658 sub foaas_particular
{
659 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
660 request
'particular', @_;
663 BEGIN { *particular
= \
&foaas_particular
}
665 =item foaas_pink $from
670 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
674 BEGIN { *pink
= \
&foaas_pink
}
676 =item foaas_problem $name, $from
681 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
682 request
'problem', @_;
685 BEGIN { *problem
= \
&foaas_problem
}
687 =item foaas_programmer $from
691 sub foaas_programmer
{
692 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
693 request
'programmer', @_;
696 BEGIN { *programmer
= \
&foaas_programmer
}
698 =item foaas_pulp $language, $from
703 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
707 BEGIN { *pulp
= \
&foaas_pulp
}
709 =item foaas_question $from
714 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
715 request
'question', @_;
718 BEGIN { *question
= \
&foaas_question
}
720 =item foaas_retard $from
725 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
726 request
'retard', @_;
729 BEGIN { *retard
= \
&foaas_retard
}
731 =item foaas_ridiculous $from
735 sub foaas_ridiculous
{
736 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
737 request
'ridiculous', @_;
740 BEGIN { *ridiculous
= \
&foaas_ridiculous
}
742 =item foaas_rtfm $from
747 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
751 BEGIN { *rtfm
= \
&foaas_rtfm
}
753 =item foaas_sake $from
758 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
762 BEGIN { *sake
= \
&foaas_sake
}
764 =item foaas_shakespeare $name, $from
768 sub foaas_shakespeare
{
769 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
770 request
'shakespeare', @_;
773 BEGIN { *shakespeare
= \
&foaas_shakespeare
}
775 =item foaas_shit $from
780 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
784 BEGIN { *shit
= \
&foaas_shit
}
786 =item foaas_shutup $name, $from
791 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
792 request
'shutup', @_;
795 BEGIN { *shutup
= \
&foaas_shutup
}
797 =item foaas_single $from
802 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
803 request
'single', @_;
806 BEGIN { *single
= \
&foaas_single
}
808 =item foaas_thanks $from
813 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
814 request
'thanks', @_;
817 BEGIN { *thanks
= \
&foaas_thanks
}
819 =item foaas_that $from
824 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
828 BEGIN { *that
= \
&foaas_that
}
830 =item foaas_think $name, $from
835 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
839 BEGIN { *think
= \
&foaas_think
}
841 =item foaas_thinking $name, $from
846 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
847 request
'thinking', @_;
850 BEGIN { *thinking
= \
&foaas_thinking
}
852 =item foaas_this $from
857 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
861 BEGIN { *this
= \
&foaas_this
}
863 =item foaas_thumbs $name, $from
868 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
869 request
'thumbs', @_;
872 BEGIN { *thumbs
= \
&foaas_thumbs
}
874 =item foaas_too $from
879 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
883 BEGIN { *too
= \
&foaas_too
}
885 =item foaas_tucker $from
890 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
891 request
'tucker', @_;
894 BEGIN { *tucker
= \
&foaas_tucker
}
901 die "Expected 0 arguments" unless @_ == 0 || @_ == 1;
902 request
'version', @_;
905 BEGIN { *version
= \
&foaas_version
}
907 =item foaas_what $from
912 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
916 BEGIN { *what
= \
&foaas_what
}
918 =item foaas_xmas $name, $from
923 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
927 BEGIN { *xmas
= \
&foaas_xmas
}
929 =item foaas_yoda $name, $from
934 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
938 BEGIN { *yoda
= \
&foaas_yoda
}
940 =item foaas_you $name, $from
945 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
949 BEGIN { *you
= \
&foaas_you
}
951 =item foaas_zayn $from
956 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
960 BEGIN { *zayn
= \
&foaas_zayn
}
962 =item foaas_zero $from
967 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
971 BEGIN { *zero
= \
&foaas_zero
}
974 our @EXPORT = qw
/foaas_anyway foaas_asshole foaas_awesome foaas_back foaas_bag foaas_ballmer foaas_bday foaas_because foaas_blackadder foaas_bm foaas_bucket foaas_bus foaas_bye foaas_caniuse foaas_chainsaw foaas_cocksplat foaas_cool foaas_cup foaas_dalton foaas_deraadt foaas_diabetes foaas_donut foaas_dosomething foaas_equity foaas_everyone foaas_everything foaas_family foaas_fascinating foaas_field foaas_flying foaas_fyyff foaas_gfy foaas_give foaas_greed foaas_horse foaas_immensity foaas_ing foaas_keep foaas_keepcalm foaas_king foaas_life foaas_linus foaas_look foaas_looking foaas_madison foaas_maybe foaas_me foaas_mornin foaas_no foaas_nugget foaas_off foaas_off_with foaas_outside foaas_particular foaas_pink foaas_problem foaas_programmer foaas_pulp foaas_question foaas_retard foaas_ridiculous foaas_rtfm foaas_sake foaas_shakespeare foaas_shit foaas_shutup foaas_single foaas_thanks foaas_that foaas_think foaas_thinking foaas_this foaas_thumbs foaas_too foaas_tucker foaas_version foaas_what foaas_xmas foaas_yoda foaas_you foaas_zayn foaas_zero/;
975 our @EXPORT_OK = qw
/foaas_anyway foaas_asshole foaas_awesome foaas_back foaas_bag foaas_ballmer foaas_bday foaas_because foaas_blackadder foaas_bm foaas_bucket foaas_bus foaas_bye foaas_caniuse foaas_chainsaw foaas_cocksplat foaas_cool foaas_cup foaas_dalton foaas_deraadt foaas_diabetes foaas_donut foaas_dosomething foaas_equity foaas_everyone foaas_everything foaas_family foaas_fascinating foaas_field foaas_flying foaas_fyyff foaas_gfy foaas_give foaas_greed foaas_horse foaas_immensity foaas_ing foaas_keep foaas_keepcalm foaas_king foaas_life foaas_linus foaas_look foaas_looking foaas_madison foaas_maybe foaas_me foaas_mornin foaas_no foaas_nugget foaas_off foaas_off_with foaas_outside foaas_particular foaas_pink foaas_problem foaas_programmer foaas_pulp foaas_question foaas_retard foaas_ridiculous foaas_rtfm foaas_sake foaas_shakespeare foaas_shit foaas_shutup foaas_single foaas_thanks foaas_that foaas_think foaas_thinking foaas_this foaas_thumbs foaas_too foaas_tucker foaas_version foaas_what foaas_xmas foaas_yoda foaas_you foaas_zayn foaas_zero anyway asshole awesome back bag ballmer bday because blackadder bm bucket bus bye caniuse chainsaw cocksplat cool cup dalton deraadt diabetes donut dosomething equity everyone everything family fascinating field flying fyyff gfy give greed horse immensity ing keep keepcalm king life linus look looking madison maybe me mornin no nugget off off_with outside particular pink problem programmer pulp question retard ridiculous rtfm sake shakespeare shit shutup single thanks that think thinking this thumbs too tucker version what xmas yoda you zayn zero/;
982 ### End of code generated by WebService::FOAAS::Codegen->run
993 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
995 =head1 COPYRIGHT AND LICENSE
997 Copyright (C) 2017-2018 by Marius Gavrilescu
999 This library is free software; you can redistribute it and/or modify
1000 it under the same terms as Perl itself, either Perl version 5.22.3 or,
1001 at your option, any later version of Perl 5 you may have available.
This page took 0.109452 seconds and 5 git commands to generate.