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

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

πŸ’– NAME πŸ’–

Net::GitHub::V3::Events β€” bestie, this is the GitHub Events API wrapper, and it's giving "I keep up with literally everything that happens on GitHub" energy πŸ’…

(you're reading Net::G...:Events(3pm) from the User Contributed Perl Documentation btw, iconic of you to show up 🫢)


✨ SYNOPSIS ✨

Okay so first you gotta make your GitHub object, and the readme over at Net::GitHub::V3 is where you go to set up your authentication correctly (do NOT skip that part, it's the whole vibe check):

use Net::GitHub::V3;

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

Boom. You got your $event object and now we're cooking πŸ“


🌸 DESCRIPTION 🌸

πŸŽ€ METHODS πŸŽ€

🌈 Events 🌈

The canonical docs live right here, go read them, they ate:

<http://developer.github.com/v3/activity/events/>

✨ events ✨

Grab every single event, one at a time if you're feeling dainty about memory:

my @events = $event->events();
while (my $ne = $event->next_event) { ...; }

πŸ¦‹ repos_events Β· issues_events Β· networks_events πŸ¦‹

The scoped trio β€” you pass in a $user and a $repo and it gives you that specific lil corner of the timeline. And yes, each one has its own next_* iterator so you can stream them like the main character you are:

my @events = $event->repos_events($user, $repo);
my @events = $event->issues_events($user, $repo);
my @events = $event->networks_events($user, $repo);
while (my $ur_event = $event->next_repos_event($user,$repo) { ...; }
while (my $ur_event = $event->next_issues_event($user,$repo) { ...; }
while (my $ur_event = $event->next_networks_event($user,$repo) { ...; }

πŸ’œ orgs_events πŸ’œ

Same deal but for a whole organization, because orgs have lore too:

my @events = $event->orgs_events($org);
while (my $org_event = $event->next_orgs_event) { ...; }

🧚 user_received_events · user_public_received_events · user_events · user_public_events 🧚

Four flavors of "what's up with this user": the stuff they received, the public stuff they received, the stuff they did, and the public stuff they did. Pick your filter, they all come with iterators:

my @events = $event->user_received_events($user);
my @events = $event->user_public_received_events($user);
my @events = $event->user_events($user);
my @events = $event->user_public_events($user);
while (my $u_event = $event->next_user_received_event) { ...; }
while (my $u_event = $event->next_user_public_received_event) { ...; }
while (my $u_event = $event->next_user_event) { ...; }
while (my $u_event = $event->next_user_public_event) { ...; }

πŸ‘‘ user_orgs_events πŸ‘‘

The crossover episode: a $user and an $org, together at last. Note the iterator is named next_org_event β€” yes, that's the name, no cap, don't come for me:

my @events = $event->user_orgs_events($user, $org);
while (my $o_event = $event->next_org_event) { ...; }

This one just says: Refer Net::GitHub. That's it, that's the whole section β€” the receipts live over there, bestie πŸ’–


and that's the whole page, you're officially an Events API girlie now πŸ’…βœ¨ This lil drop is from perl v5.36.0, dated 2022-10-08 β€” go forth and poll responsibly, ily πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from