]>
iEval git - webservice-foaas.git/blob - lib/WebService/FOAAS.pm
9a00b4f1eeccd2961efd8a793aebf1bcb09db826
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.001001';
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_awesome $from
87 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
88 request
'awesome', @_;
91 BEGIN { *awesome
= \
&foaas_awesome
}
93 =item foaas_back $name, $from
98 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
102 BEGIN { *back
= \
&foaas_back
}
104 =item foaas_bag $from
109 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
113 BEGIN { *bag
= \
&foaas_bag
}
115 =item foaas_ballmer $name, $company, $from
120 die "Expected 3 arguments" unless @_ == 3 || @_ == 4;
121 request
'ballmer', @_;
124 BEGIN { *ballmer
= \
&foaas_ballmer
}
126 =item foaas_bday $name, $from
131 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
135 BEGIN { *bday
= \
&foaas_bday
}
137 =item foaas_because $from
142 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
143 request
'because', @_;
146 BEGIN { *because
= \
&foaas_because
}
148 =item foaas_blackadder $name, $from
152 sub foaas_blackadder
{
153 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
154 request
'blackadder', @_;
157 BEGIN { *blackadder
= \
&foaas_blackadder
}
159 =item foaas_bm $name, $from
164 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
168 BEGIN { *bm
= \
&foaas_bm
}
170 =item foaas_bucket $from
175 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
176 request
'bucket', @_;
179 BEGIN { *bucket
= \
&foaas_bucket
}
181 =item foaas_bus $name, $from
186 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
190 BEGIN { *bus
= \
&foaas_bus
}
192 =item foaas_bye $from
197 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
201 BEGIN { *bye
= \
&foaas_bye
}
203 =item foaas_caniuse $tool, $from
208 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
209 request
'caniuse', @_;
212 BEGIN { *caniuse
= \
&foaas_caniuse
}
214 =item foaas_chainsaw $name, $from
219 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
220 request
'chainsaw', @_;
223 BEGIN { *chainsaw
= \
&foaas_chainsaw
}
225 =item foaas_cocksplat $name, $from
229 sub foaas_cocksplat
{
230 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
231 request
'cocksplat', @_;
234 BEGIN { *cocksplat
= \
&foaas_cocksplat
}
236 =item foaas_cool $from
241 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
245 BEGIN { *cool
= \
&foaas_cool
}
247 =item foaas_dalton $name, $from
252 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
253 request
'dalton', @_;
256 BEGIN { *dalton
= \
&foaas_dalton
}
258 =item foaas_deraadt $name, $from
263 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
264 request
'deraadt', @_;
267 BEGIN { *deraadt
= \
&foaas_deraadt
}
269 =item foaas_diabetes $from
274 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
275 request
'diabetes', @_;
278 BEGIN { *diabetes
= \
&foaas_diabetes
}
280 =item foaas_donut $name, $from
285 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
289 BEGIN { *donut
= \
&foaas_donut
}
291 =item foaas_dosomething $do, $something, $from
295 sub foaas_dosomething
{
296 die "Expected 3 arguments" unless @_ == 3 || @_ == 4;
297 request
'dosomething', @_;
300 BEGIN { *dosomething
= \
&foaas_dosomething
}
302 =item foaas_everyone $from
307 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
308 request
'everyone', @_;
311 BEGIN { *everyone
= \
&foaas_everyone
}
313 =item foaas_everything $from
317 sub foaas_everything
{
318 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
319 request
'everything', @_;
322 BEGIN { *everything
= \
&foaas_everything
}
324 =item foaas_family $from
329 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
330 request
'family', @_;
333 BEGIN { *family
= \
&foaas_family
}
335 =item foaas_fascinating $from
339 sub foaas_fascinating
{
340 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
341 request
'fascinating', @_;
344 BEGIN { *fascinating
= \
&foaas_fascinating
}
346 =item foaas_field $name, $from, $reference
351 die "Expected 3 arguments" unless @_ == 3 || @_ == 4;
355 BEGIN { *field
= \
&foaas_field
}
357 =item foaas_flying $from
362 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
363 request
'flying', @_;
366 BEGIN { *flying
= \
&foaas_flying
}
368 =item foaas_gfy $name, $from
373 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
377 BEGIN { *gfy
= \
&foaas_gfy
}
379 =item foaas_give $from
384 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
388 BEGIN { *give
= \
&foaas_give
}
390 =item foaas_greed $noun, $from
395 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
399 BEGIN { *greed
= \
&foaas_greed
}
401 =item foaas_horse $from
406 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
410 BEGIN { *horse
= \
&foaas_horse
}
412 =item foaas_ing $name, $from
417 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
421 BEGIN { *ing
= \
&foaas_ing
}
423 =item foaas_keep $name, $from
428 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
432 BEGIN { *keep
= \
&foaas_keep
}
434 =item foaas_keepcalm $reaction, $from
439 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
440 request
'keepcalm', @_;
443 BEGIN { *keepcalm
= \
&foaas_keepcalm
}
445 =item foaas_king $name, $from
450 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
454 BEGIN { *king
= \
&foaas_king
}
456 =item foaas_life $from
461 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
465 BEGIN { *life
= \
&foaas_life
}
467 =item foaas_linus $name, $from
472 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
476 BEGIN { *linus
= \
&foaas_linus
}
478 =item foaas_look $name, $from
483 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
487 BEGIN { *look
= \
&foaas_look
}
489 =item foaas_looking $from
494 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
495 request
'looking', @_;
498 BEGIN { *looking
= \
&foaas_looking
}
500 =item foaas_madison $name, $from
505 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
506 request
'madison', @_;
509 BEGIN { *madison
= \
&foaas_madison
}
511 =item foaas_maybe $from
516 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
520 BEGIN { *maybe
= \
&foaas_maybe
}
527 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
531 BEGIN { *me
= \
&foaas_me
}
533 =item foaas_mornin $from
538 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
539 request
'mornin', @_;
542 BEGIN { *mornin
= \
&foaas_mornin
}
549 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
553 BEGIN { *no = \
&foaas_no
}
555 =item foaas_nugget $name, $from
560 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
561 request
'nugget', @_;
564 BEGIN { *nugget
= \
&foaas_nugget
}
566 =item foaas_off $name, $from
571 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
575 BEGIN { *off
= \
&foaas_off
}
577 =item foaas_off_with $behavior, $from
582 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
583 request
'off_with', @_;
586 BEGIN { *off_with
= \
&foaas_off_with
}
588 =item foaas_outside $name, $from
593 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
594 request
'outside', @_;
597 BEGIN { *outside
= \
&foaas_outside
}
599 =item foaas_particular $thing, $from
603 sub foaas_particular
{
604 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
605 request
'particular', @_;
608 BEGIN { *particular
= \
&foaas_particular
}
610 =item foaas_pink $from
615 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
619 BEGIN { *pink
= \
&foaas_pink
}
621 =item foaas_problem $name, $from
626 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
627 request
'problem', @_;
630 BEGIN { *problem
= \
&foaas_problem
}
632 =item foaas_pulp $language, $from
637 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
641 BEGIN { *pulp
= \
&foaas_pulp
}
643 =item foaas_retard $from
648 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
649 request
'retard', @_;
652 BEGIN { *retard
= \
&foaas_retard
}
654 =item foaas_ridiculous $from
658 sub foaas_ridiculous
{
659 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
660 request
'ridiculous', @_;
663 BEGIN { *ridiculous
= \
&foaas_ridiculous
}
665 =item foaas_rtfm $from
670 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
674 BEGIN { *rtfm
= \
&foaas_rtfm
}
676 =item foaas_sake $from
681 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
685 BEGIN { *sake
= \
&foaas_sake
}
687 =item foaas_shakespeare $name, $from
691 sub foaas_shakespeare
{
692 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
693 request
'shakespeare', @_;
696 BEGIN { *shakespeare
= \
&foaas_shakespeare
}
698 =item foaas_shit $from
703 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
707 BEGIN { *shit
= \
&foaas_shit
}
709 =item foaas_shutup $name, $from
714 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
715 request
'shutup', @_;
718 BEGIN { *shutup
= \
&foaas_shutup
}
720 =item foaas_single $from
725 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
726 request
'single', @_;
729 BEGIN { *single
= \
&foaas_single
}
731 =item foaas_thanks $from
736 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
737 request
'thanks', @_;
740 BEGIN { *thanks
= \
&foaas_thanks
}
742 =item foaas_that $from
747 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
751 BEGIN { *that
= \
&foaas_that
}
753 =item foaas_think $name, $from
758 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
762 BEGIN { *think
= \
&foaas_think
}
764 =item foaas_thinking $name, $from
769 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
770 request
'thinking', @_;
773 BEGIN { *thinking
= \
&foaas_thinking
}
775 =item foaas_this $from
780 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
784 BEGIN { *this
= \
&foaas_this
}
786 =item foaas_thumbs $name, $from
791 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
792 request
'thumbs', @_;
795 BEGIN { *thumbs
= \
&foaas_thumbs
}
797 =item foaas_too $from
802 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
806 BEGIN { *too
= \
&foaas_too
}
808 =item foaas_tucker $from
813 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
814 request
'tucker', @_;
817 BEGIN { *tucker
= \
&foaas_tucker
}
824 die "Expected 0 arguments" unless @_ == 0 || @_ == 1;
825 request
'version', @_;
828 BEGIN { *version
= \
&foaas_version
}
830 =item foaas_what $from
835 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
839 BEGIN { *what
= \
&foaas_what
}
841 =item foaas_xmas $name, $from
846 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
850 BEGIN { *xmas
= \
&foaas_xmas
}
852 =item foaas_yoda $name, $from
857 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
861 BEGIN { *yoda
= \
&foaas_yoda
}
863 =item foaas_you $name, $from
868 die "Expected 2 arguments" unless @_ == 2 || @_ == 3;
872 BEGIN { *you
= \
&foaas_you
}
874 =item foaas_zayn $from
879 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
883 BEGIN { *zayn
= \
&foaas_zayn
}
885 =item foaas_zero $from
890 die "Expected 1 arguments" unless @_ == 1 || @_ == 2;
894 BEGIN { *zero
= \
&foaas_zero
}
897 our @EXPORT = qw
/foaas_anyway 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_dalton foaas_deraadt foaas_diabetes foaas_donut foaas_dosomething foaas_everyone foaas_everything foaas_family foaas_fascinating foaas_field foaas_flying foaas_gfy foaas_give foaas_greed foaas_horse 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_pulp 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/;
898 our @EXPORT_OK = qw
/foaas_anyway 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_dalton foaas_deraadt foaas_diabetes foaas_donut foaas_dosomething foaas_everyone foaas_everything foaas_family foaas_fascinating foaas_field foaas_flying foaas_gfy foaas_give foaas_greed foaas_horse 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_pulp 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 awesome back bag ballmer bday because blackadder bm bucket bus bye caniuse chainsaw cocksplat cool dalton deraadt diabetes donut dosomething everyone everything family fascinating field flying gfy give greed horse ing keep keepcalm king life linus look looking madison maybe me mornin no nugget off off_with outside particular pink problem pulp retard ridiculous rtfm sake shakespeare shit shutup single thanks that think thinking this thumbs too tucker version what xmas yoda you zayn zero/;
905 ### End of code generated by WebService::FOAAS::Codegen->run
916 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
918 =head1 COPYRIGHT AND LICENSE
920 Copyright (C) 2017 by Marius Gavrilescu
922 This library is free software; you can redistribute it and/or modify
923 it under the same terms as Perl itself, either Perl version 5.22.3 or,
924 at your option, any later version of Perl 5 you may have available.
This page took 0.089646 seconds and 4 git commands to generate.