├── requirements.txt
├── .idea
├── encodings.xml
├── vcs.xml
├── misc.xml
├── modules.xml
└── arxiv-daily.iml
├── config.py
├── .github
└── workflows
│ └── report.yml
├── README.md
├── github_issue.py
└── main.py
/requirements.txt:
--------------------------------------------------------------------------------
1 | beautifulsoup4==4.6.3
2 | requests==2.19.1
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/arxiv-daily.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/config.py:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | from __future__ import absolute_import
3 | from __future__ import division
4 | from __future__ import print_function
5 | from __future__ import unicode_literals
6 |
7 | # The repository to add this issue to
8 | REPO_OWNER = 'DongZhouGu'
9 | REPO_NAME = 'arxiv-daily'
10 |
11 | # Set new submission url of subject
12 | NEW_SUB_URL = 'https://arxiv.org/list/cs/new'
13 |
14 | # Keywords to search
15 | KEYWORD_LIST = ["human object interaction", "visual relation detection", "object detection", "transformer",
16 | "scene understanding", "visual reasoning"]
17 |
--------------------------------------------------------------------------------
/.github/workflows/report.yml:
--------------------------------------------------------------------------------
1 | name: Daily Arxiv
2 |
3 | on:
4 | schedule:
5 | - cron: '0 2 * * mon-fri'
6 | workflow_dispatch:
7 |
8 | jobs:
9 | build:
10 |
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v2
15 | - name: Set up Python 3.8
16 | uses: actions/setup-python@v2
17 | with:
18 | python-version: 3.8
19 | - name: Install dependencies
20 | run: |
21 | python -m pip install --upgrade pip
22 | pip install -r requirements.txt
23 | - name: Report
24 | env:
25 | GITHUB: ${{ secrets.GITHUB }}
26 | run: "python -u main.py"
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # get-daily-arxiv-noti
2 |
3 | This repository is build based on [here](github.com/kobiso/get-daily-arxiv-noti)
4 |
5 | - Subject: computer science (cs)
6 | - Keywords: "human object interaction", "visual relation detection", "object detection", "transformer","scene understanding", "visual reasoning"
7 |
8 | ## Usage( github actions)
9 |
10 | #### 0. ⭐Star⭐
11 |
12 | #### 1.Clone this Repo and Create a Repo
13 |
14 | - Create a repository to get notification in your github.
15 | - **click "Settings"->"Secrets"->"New repository secret"**
16 |
17 | ```python
18 | Name: GITHUB
19 | # Authentication for user filing issue (must have read/write access to repository to add issue to)
20 | Value: your_github_username,your_github_token
21 | ```
22 |
23 | #### 2. Set Config
24 |
25 | **update`config.py` as your perferences.**
26 |
27 | ```python
28 |
29 | # The repository to add this issue to
30 | REPO_OWNER = 'changeme'
31 | REPO_NAME = 'changeme'
32 |
33 | # Set new submission url of subject
34 | NEW_SUB_URL = 'https://arxiv.org/list/cs/new'
35 |
36 | # Keywords to search
37 | KEYWORD_LIST = ["changeme"]
38 | ```
39 |
40 | #### 3. workflow
41 |
42 | To test the functionality, you can click " Run Workflow button" for an immediate run.
43 |
44 |
--------------------------------------------------------------------------------
/github_issue.py:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | from __future__ import absolute_import
3 | from __future__ import division
4 | from __future__ import print_function
5 | from __future__ import unicode_literals
6 |
7 | import json
8 | import requests
9 | from config import REPO_OWNER, REPO_NAME
10 |
11 |
12 | def make_github_issue(title, body=None, assignee=None, TOKEN=None, closed=False, labels=[]):
13 | # Create an issue on github.com using the given parameters
14 | # Url to create issues via POST
15 | url = 'https://api.github.com/repos/%s/%s/import/issues' % (REPO_OWNER, REPO_NAME)
16 |
17 | # Headers
18 | headers = {
19 | "Authorization": "token %s" % TOKEN,
20 | "Accept": "application/vnd.github.golden-comet-preview+json"
21 | }
22 |
23 | # Create our issue
24 | data = {'issue': {'title': title,
25 | 'body': body,
26 | 'assignee': assignee,
27 | 'closed': closed,
28 | 'labels': labels}}
29 |
30 | payload = json.dumps(data)
31 |
32 | # Add the issue to our repository
33 | response = requests.request("POST", url, data=payload, headers=headers)
34 | if response.status_code == 202:
35 | print('Successfully created Issue "%s"' % title)
36 | else:
37 | print('Could not create Issue "%s"' % title)
38 | print('Response:', response.content)
39 |
40 |
41 | if __name__ == '__main__':
42 | title = 'Pretty title'
43 | body = 'Beautiful body'
44 | assignee = ''
45 | TOKEN = ''
46 | closed = False
47 | labels = ["bug"]
48 | make_github_issue(title, body, assignee, TOKEN, closed, labels)
49 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | from __future__ import absolute_import
3 | from __future__ import division
4 | from __future__ import print_function
5 | from __future__ import unicode_literals
6 |
7 | import os
8 |
9 | from bs4 import BeautifulSoup as bs
10 | import urllib.request
11 |
12 | from github_issue import make_github_issue
13 | from config import NEW_SUB_URL, KEYWORD_LIST
14 |
15 |
16 | def main():
17 | page = urllib.request.urlopen(NEW_SUB_URL)
18 | soup = bs(page)
19 | content = soup.body.find("div", {'id': 'content'})
20 |
21 | issue_title = content.find("h3").text
22 | dt_list = content.dl.find_all("dt")
23 | dd_list = content.dl.find_all("dd")
24 | arxiv_base = "https://arxiv.org/abs/"
25 |
26 | assert len(dt_list) == len(dd_list)
27 |
28 | keyword_list = KEYWORD_LIST
29 | keyword_dict = {key: [] for key in keyword_list}
30 |
31 | for i in range(len(dt_list)):
32 | paper = {}
33 | paper_number = dt_list[i].text.strip().split(" ")[2].split(":")[-1]
34 | paper['main_page'] = arxiv_base + paper_number
35 | paper['pdf'] = arxiv_base.replace('abs', 'pdf') + paper_number
36 |
37 | paper['title'] = dd_list[i].find("div", {"class": "list-title mathjax"}).text.replace("Title: ", "").strip()
38 | paper['authors'] = dd_list[i].find("div", {"class": "list-authors"}).text.replace("Authors:\n", "").replace(
39 | "\n", "").strip()
40 | paper['subjects'] = dd_list[i].find("div", {"class": "list-subjects"}).text.replace("Subjects: ", "").strip()
41 | paper['abstract'] = dd_list[i].find("p", {"class": "mathjax"}).text.replace("\n", " ").strip()
42 |
43 | for keyword in keyword_list:
44 | if keyword.lower() in paper['abstract'].lower():
45 | keyword_dict[keyword].append(paper)
46 |
47 | full_report = ''
48 | for keyword in keyword_list:
49 | full_report = full_report + '## Keyword: ' + keyword + '\n'
50 |
51 | if len(keyword_dict[keyword]) == 0:
52 | full_report = full_report + 'There is no result \n'
53 |
54 | for paper in keyword_dict[keyword]:
55 | report = '### {}\n - **Authors:** {}\n - **Subjects:** {}\n - **Arxiv link:** {}\n - **Pdf link:** {}\n - **Abstract**\n {}' \
56 | .format(paper['title'], paper['authors'], paper['subjects'], paper['main_page'], paper['pdf'],
57 | paper['abstract'])
58 | full_report = full_report + report + '\n'
59 |
60 | # Authentication for user filing issue (must have read/write access to repository to add issue to)
61 | if 'GITHUB' in os.environ:
62 | USERNAME, TOKEN = os.environ['GITHUB'].split(',')
63 | make_github_issue(title=issue_title, body=full_report, assignee=USERNAME, TOKEN=TOKEN, labels=keyword_list)
64 |
65 |
66 | if __name__ == '__main__':
67 | main()
68 |
--------------------------------------------------------------------------------