Net::G...:Users(3pm)

πŸ“¦
version 1.05 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Okay bestie, so this page is Net::G...:Users(3pm) β€” it's from the User Contributed Perl Documentation and it's literally the whole GitHub Users API wrapped up in Perl for you. Net::GitHub::V3::Users, periodt. πŸ’…


✨ SYNOPSIS ✨

No thoughts, just vibes, just code:

use Net::GitHub::V3;

my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
my $user = $gh->user;

Quick heads-up queen: you gotta read Net::GitHub::V3 to set right authentication info. Do that first, or nothing's gonna hit. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

πŸŽ€ METHODS πŸŽ€

πŸ‘‘ Users

The link, unchanged, no cap: <http://developer.github.com/v3/users/>

  • show β€” pulls the user info, and yes it can be your own little profile or somebody else's, your call:
my $uinfo = $user->show(); # /user
my $uinfo = $user->show( 'nothingmuch' ); # /users/:user
  • update β€” glow-up time, change your own stuff:
$user->update(
    bio  => 'another Perl programmer and Father',
);

πŸ“ Emails

Link again, exactly as it is: <http://developer.github.com/v3/users/emails/>

The squad of methods: emails, add_email, remove_email.

$user->add_email( 'another@email.com' );
$user->add_email( 'batch1@email.com', 'batch2@email.com' );
my $emails = $user->emails;
while ($email = $user->next_email) { ...; }
$user->remove_email( 'another@email.com' );
$user->remove_email( 'batch1@email.com', 'batch2@email.com' );

Not me noticing add_email and remove_email will happily take a whole batch of addresses at once. Obsessed. ✨


πŸ¦‹ Followers

The URL, untouched: <http://developer.github.com/v3/users/followers/>

The lineup: followers, following, next_follower, next_following.

my $followers = $user->followers;
my $followers = $user->followers($user);
my $following = $user->following;
my $following = $user->following($user);
my $next_follower = $user->next_follower
my $next_follower = $user->next_follower($user)
my $next_following = $user->next_following
my $next_following = $user->next_following($user)
  • is_following β€” the vibe check, mutuals check, "are they following this person" check:
my $is_following = $user->is_following($user);
  • follow and unfollow β€” the follow/unfollow, the classic main character move:
$user->follow( 'nothingmuch' );
$user->unfollow( 'nothingmuch' );

🌸 Keys

The link, as-is: <http://developer.github.com/v3/users/keys/>

The whole roster: keys, key, create_key, update_key, delete_key.

my $keys = $user->keys;
while (my $key = $user->next_key) { ...; }
my $key  = $user->key($key_id); # get key
$user->create_key({
    title => 'title',
    key   => $key
});
$user->update_key($key_id, {
    title => $title,
    key   => $key
});
$user->delete_key($key_id);

🌈 contributions

  • contributions β€” the little graph detective:
my $contributions = $user->contributions($username);
# $contributions = ( ..., ['2013/09/22', 3], [ '2013/09/23', 2 ] )

Okay so here's the lore 🧚: this is an Unpublished GitHub API used to build the 'Public contributions' graph on a users' profile page. The data structure is a list of 365 arrayrefs, one per day. Each array has two elements, the date in YYYY/MM/DD format is the first element, the second is the number of contrubtions for that day.stree .

Bestie, that last bit is word-for-word what the page says β€” day.stree . and all. I am NOT editing it. It's giving haunted. πŸ’€

Refer Net::GitHub.


And that's the whole page, angel! πŸ’œ It was Net::G...:Users(3pm), a piece of the User Contributed Perl Documentation, dated 2022-10-08, built for perl v5.36.0. Go forth and slay those API calls, mwah. πŸŽ€πŸ’–

πŸ“¦ where this page comes from