6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/github_activities/comment_and_reaction.rb', line 6
def get(options)
Octokit.configure do |c|
c.login = options[:login_user]
c.password = options[:password]
end
name = options[:name]
repository = options[:repository]
pages = options[:pages]
puts name
puts repository
puts pages
result = []
client = Octokit::Client.new
(1..pages).each do |index|
client.pulls(repository, state: :all, page: index).map(&:number).each do |number|
client.issue_reactions(repository, number, :accept => 'application/vnd.github.squirrel-girl-preview').
select {|reaction| reaction.user.login == name}.
each {|reaction|
result << OpenStruct.new(user_id: name, number: number, content: reaction.content, created_at: reaction.created_at)
}
client.(repository, number).
select {|| .user.login == name}.
each {||
result << OpenStruct.new(user_id: name, number: number, content: .body, created_at: .created_at)
}
client.(repository, number).
select {|| .user.login == name}.
each {||
result << OpenStruct.new(user_id: name, number: number, content: .body, created_at: .created_at)
}
end
end
puts '----------'
puts '----------'
puts '----------'
result.sort_by(&:created_at).each do |reaction|
p reaction
end
nil
end
|