Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webmagic
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
webmagic
Commits
f8a2328e
Commit
f8a2328e
authored
Dec 02, 2016
by
Jsbd
Committed by
GitHub
Dec 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from code4craft/master
merge
parents
ebc61363
1987cd3a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
pom.xml
webmagic-scripts/pom.xml
+5
-0
Github.groovy
webmagic-scripts/src/main/groovy/Github.groovy
+18
-0
No files found.
webmagic-scripts/pom.xml
View file @
f8a2328e
...
@@ -16,6 +16,11 @@
...
@@ -16,6 +16,11 @@
<artifactId>
jruby
</artifactId>
<artifactId>
jruby
</artifactId>
<version>
1.7.6
</version>
<version>
1.7.6
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.codehaus.groovy
</groupId>
<artifactId>
groovy-all
</artifactId>
<version>
2.1.6
</version>
</dependency>
<dependency><groupId>
org.python
</groupId>
<dependency><groupId>
org.python
</groupId>
<artifactId>
jython
</artifactId>
<artifactId>
jython
</artifactId>
<version>
2.5.3
</version>
<version>
2.5.3
</version>
...
...
webmagic-scripts/src/main/groovy/Github.groovy
0 → 100644
View file @
f8a2328e
Github
{
Site
{
sleepTime
0
timeOut
100
retryTimes
3
userAgent
[
'a'
,
'b'
,
'c'
].
random
}
match
"https://github.com/\\w+/\\w+"
{
addUrl
(
url
.
regex
(
"https://github.com/\\w+/\\w+"
))
return
{
name:
html
.
xpath
(
"//h1[@class='entry-title public']/strong/a/text()"
)
author:
html
.
xpath
"https://github\\.com/(\\w+)/.*"
readme:
html
.
xpath
"//div[@id='readme']/tidyText()"
star
:
toInt
(
html
.
xpath
(
"//div[@id='readme']/tidyText()"
))
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment