-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
64 lines (57 loc) · 1.83 KB
/
main.lua
1
2
3
4
5
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
52
53
54
55
56
57
58
59
60
61
62
63
64
require "import"
--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
Github = require("github.Github")
Github:init {
"SimpleIssue",
"SimplePull",
"Searcher",
"GithubUser",
"IssuesCollection",
"PullsCollection",
"Repository"
}
:token("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")
Github:search()
:keyword("material-components")
:filter("language", "java")
:start(function(data)
local repository =
Github:repo(data.items[1].full_name)
:config(function(data)
print("Repository name", data.owner.login)
GithubUser:new(data.owner.login)
:config(function(data)
print(
"Repository owner's following number",
tointeger(data.followers)
)
end)
end)
repository
:issues()
:state(IssuesCollection.STATE_OPEN)
:page(1)
:get(function(data)
print("Issue Page 1 :Total", #data)
SimpleIssue:new {
id = data[1].number,
repo = repository.name,
}
:config(function(data)
print("First Issue\n", data.title)
end)
end)
repository
:pulls()
:page(2)
:get(function(data)
print("Pull Requests Page 2 :Total", #data)
SimplePull:new {
id = data[2].number,
repo = repository.name,
}
:config(function(data)
print("Second Pull\n", data.title)
end)
end)
end)