WWW::F...Canvas(3pm)

πŸ“¦
version 0.4.18 Β· 2 versions
  • 0.4.18 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.4.18 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– WWW::Facebook::API::Canvas β€” the manual, but make it cute πŸ’–

okay bestie, welcome to WWW::Facebook::API::Canvas (a.k.a. WWW::F...Canvas if you're reading the terse little title bar, which, respectfully, is giving censored-for-the-girlies energy). This is the Facebook Canvas page from the User Contributed Perl Documentation collection. Sit down, hydrate, let's go. 🫢


✨ NAME ✨

WWW::Facebook::API::Canvas β€” Facebook Canvas. That's it, that's the name. Iconic brevity.


🌸 SYNOPSIS 🌸

use WWW::Facebook::API;

...and that's literally the whole synopsis, bestie. You pull in the parent module and the canvas stuff rides along. Slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

These are the methods for using the canvas with WWW::Facebook::API. That's the whole vibe: you got a Facebook app, it lives inside a canvas, and this module helps you talk to it.

Now here's the important bit, and I need you locked in for it: the $q parameter needs to implement the param and cookie methods. Like, for example a CGI object or an Apache::Request object. If your $q can't do param and cookie, it's not the moment, it's not the vibe, it won't work. No cap. πŸ’…


πŸ‘‘ SUBROUTINES/METHODS πŸ‘‘

⭐ base

Returns the WWW::Facebook::API base object. That's your little home base, your anchor, your main character's origin story.

⭐ new

Constructor. New object, new era, new you. ✨

⭐ get_user( $q )

Returns the UID of the canvas user, or "" if it doesn't exist (peep the DESCRIPTION, bestie, that's where the $q rules live).

$response = $client->canvas->get_user( $q )

If you don't pass $q in, it just uses whatever $client->base->query() hands back. Convenient fr fr. πŸ™ˆ

⭐ get_fb_params( $q )

Returns a hash reference to the signed parameters that Facebook sent over (again, DESCRIPTION is your bestie here).

$response = $client->canvas->get_fb_params( $q )

No $q passed in? It falls back to the value from $client->base->query(). Easy.

⭐ get_non_fb_params( $q )

Returns a hash reference to the parameters that are not part of the signed Facebook parameters. And why do we care? Because it's lowkey the useful one: if your app sends a POST request to Facebook and you wanna actually use the data you POSTed, this is your girl. πŸŽ€

$non_fb_params = $client->canvas->get_non_fb_params( $q )

If $q isn't passed in, you guessed it, it uses the value returned by $client->base->query().

⭐ in_fb_canvas( $q )

Returns true if you're inside a canvas (DESCRIPTION, babe, DESCRIPTION).

$response = $client->canvas->in_fb_canvas( $q )

If $q is not passed in, the value returned by $self->base->query() is used. πŸ‘€ (yes, this one says $self, not $client β€” we keep the details exactly as they are, that's the rule.)

⭐ in_frame( $q )

Returns true if you're inside an iframe or a canvas (DESCRIPTION once more, you know the drill).

$response = $client->canvas->in_frame( $q )

If $q is not passed in, the value returned by $self->base->query() is used.

⭐ validate_sig( $q )

Returns a hash reference containing the fb_sig_* params (with fb_sig_ stripped off, like a little glow-up) if the signature of the $q object is valid for this application (DESCRIPTION, final boss edition).

$fb_params = $client->canvas->validate_sig( $q )
# $fb_params doesn't contain a sig key
Heads up: $fb_params does not contain a sig key. Don't go looking for it. It's not there. πŸ’€

If $q is not passed in, the value returned by $self->base->query() is used.


😭 DIAGNOSTICS 😭

Multiple values for %s. Are you using POST for forms?

Your forms are most likely using GET rather than POST to the Facebook URLs. The fix is genuinely that simple, bestie: change your forms to use POST and the problem should be resolved.

See RT#31620 and RT#31944 for more information. Receipts provided. 🧾

🌈 CONFIGURATION AND ENVIRONMENT 🌈

WWW::Facebook::API::Canvas requires no configuration files and no environment variables. Zero setup. Zero env vars. Just vibes. 🧚


πŸ’œ DEPENDENCIES πŸ’œ

See WWW::Facebook::API. That's the whole dependency situation. It's giving "go ask my mom." 🫢


πŸ“ INCOMPATIBILITIES πŸ“

None reported. Nothing beefing. Peace and love. ✌️


πŸ’€ BUGS AND LIMITATIONS πŸ’€

No bugs have been reported. (allegedly. we love a clean record.)

Please report any bugs or feature requests to bug-www-facebook-api@rt.cpan.org, or through the web interface at <http://rt.cpan.org>.


πŸ‘‘ AUTHORS πŸ‘‘

  • David Leadbeater β€” http://dgl.cx
  • David Romano β€” <unobe@cpan.org>

Two icons, one module. Periodt.


Copyright (c) 2007, David Leadbeater http://dgl.cx. Certain parts copyright (c) 2007-2010, David Romano <unobe@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. Yes queen, free software. 🌸


πŸŽ€ DISCLAIMER OF WARRANTY πŸŽ€

okay so this part is in ALL CAPS in the original and that's because it's serious business, so I'm keeping every single word of it exactly as it is, just wrapped in love:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Translation bestie: it's free, it's as-is, and if it breaks, that's on you. πŸ’€ But like, respectfully, and legally. 🫢

and that's the whole page!! ✨ this little beauty is running on perl v5.34.0, stamped 2022-06-28, filed under WWW::F...Canvas(3pm) in the User Contributed Perl Documentation shelf. go forth and canvas, bestie. πŸ¦‹πŸ’–

πŸ“¦ where this page comes from