Net::G...:Gists(3pm)
π NAME
okay so bestie, this is Net::GitHub::V3::Gists β it's the GitHub Gists API, wrapped up all cute for you in Perl. No cap. π
β¨ SYNOPSIS β¨
use Net::GitHub::V3;
my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
my $gist = $gh->gist;
like, that's the whole vibe check right there. you make the $gh object, then you grab $gist off it and go off. π
πΈ DESCRIPTION πΈ
π¦ METHODS π¦
π Git Data
<http://developer.github.com/v3/gists/> β the docs, if you wanna read the source material iykyk.
β gists
my @gists = $gist->gists;
my @gists = $gist->gists('nothingmuch');
while (my $g = $gist->next_gist) { ...; }
pass a username if you want, or don't. next_gist loops through them one at a time like a lil conveyor belt of gists. π₯
β public_gists
β starred_gists
my @gists = $gist->public_gists;
my @gists = $gist->starred_gists;
while (my $g = $gist->next_public_gist) { ...; }
while (my $g = $gist->next_starred_gist) { ...; }
same energy, different feed: public ones and the ones you starred. each has its own next_ iterator, obviously. π
β gist
my $gist = $gist->gist($gist_id);
grab one specific gist by its $gist_id. main character energy, singular. π
β create
my $gist = $gist->create( {
"description" => "the description for this gist",
"public" => 'true',
"files" => {
"file1.txt" => {
"content" => "String file contents"
}
}
} );
make a brand new gist bestie!! you gotta hand it a hashref with a description, whether it's public (note: the string 'true' here, not a real boolean, don't come for me), and a files hashref where each filename maps to a hashref holding its content. copy it exactly, fr fr. β¨
β update
my $g = $gist->update( $gist_id, {
description => "edited desc"
} );
edit an existing gist β give it the $gist_id plus a hashref of what you're changing. glow-up time. π
β star
β unstar
β is_starred
my $st = $gist->star($gist_id);
my $st = $gist->unstar($gist_id);
my $st = $gist->is_starred($gist_id);
star to bless it, unstar to un-bless it (heartbreaking, i know π), is_starred to check whether the blessing is currently active. all three just take $gist_id. π«Ά
β fork
β delete
my $g = $gist->fork($gist_id);
my $st = $gist->delete($gist_id);
fork copies someone's gist into your own little corner of the internet. delete... deletes it. gone. poof. π takes $gist_id, both of them.
π Gist Comments API
<http://developer.github.com/v3/gists/comments/> β more docs, go look if you're curious. π
β comments
β comment
β create_comment
β update_comment
β delete_comment
my @comments = $gist->comments();
while (my $c = $gist->next_comment) { ...; }
my $comment = $gist->comment($comment_id);
my $comment = $gist->create_comment($gist_id, {
"body" => "a new comment"
});
my $comment = $gist->update_comment($gist_id, $comment_id, {
"body" => "Nice change"
});
my $st = $gist->delete_comment($gist_id, $comment_id);
the comment era π β comments() pulls them all, next_comment iterates them one by one, comment($comment_id) grabs a single one, create_comment needs a $gist_id and a hashref with a body, update_comment needs the $gist_id, the $comment_id and the new body, and delete_comment needs the $gist_id and $comment_id to yeet it into the void. π
π AUTHOR & COPYRIGHT & LICENSE π
just go refer to Net::GitHub, bestie β it's all there. π
and that's the whole page!! this one shipped with perl v5.36.0 back on 2022-10-08, so if you're running something ancient that's on you π. stay iconic, go make some gists, mwah π
π¦ where this page comes from
- ubuntu noble: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms