Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subscriber names from github

I am experimenting with big query. So far I've been able to get the number of people that have watched a repository. Is it possible to get the user names of the subscribers that have watched a repository?

Thanks

like image 617
notArefill Avatar asked Dec 28 '25 18:12

notArefill


1 Answers

You can use the Events to get the actor login name of a repo. Activity archives for dates starting 1/1/2015 is recorded from the Events API..

SELECT actor.login FROM (
      TABLE_DATE_RANGE
          ( [githubarchive:day.events_]
          , TIMESTAMP('2015-01-01')
          , TIMESTAMP('2015-03-01') )
      ) 
where type='WatchEvent' and repo.name = 'ptrofimov/beanstalk_console'

For 2014 events

SELECT actor FROM (
  TABLE_QUERY([githubarchive:month],
    'REGEXP_MATCH(table_id, r"^20140\d")'
  ))
WHERE type = 'WatchEvent' and repository_name='beanstalk_console' and repository_owner='ptrofimov'
like image 183
Pentium10 Avatar answered Jan 02 '26 13:01

Pentium10