commit 442ac1426bd03fcfffb69dd4c7cbc30a74d8eab8 Author: Liuweiqing <121866954+14790897@users.noreply.github.com> Date: Tue Jan 16 10:54:40 2024 +0800 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..281a65b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,18 @@ +{ + "sqltools.connections": [ + { + "mysqlOptions": { + "authProtocol": "default", + "enableSsl": "Disabled" + }, + "previewLimit": 50, + "server": "localhost", + "port": 3306, + "driver": "MySQL", + "name": "local", + "database": "b3log_symphony", + "username": "root", + "password": "123456" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..4426f9a --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# paper-ai + 根据ai寻找到的论文自动生成引用 diff --git a/getPaper.py b/getPaper.py new file mode 100644 index 0000000..a3e20b8 --- /dev/null +++ b/getPaper.py @@ -0,0 +1,71 @@ +import arxiv + +def get_authors(authors, first_author = False): + output = str() + if first_author == False: + output = ", ".join(str(author) for author in authors) + else: + output = authors[0] + return output + +def get_daily_papers(topic,query="slam", max_results=2): + """ + @param topic: str + @param query: str + @return paper_with_code: dict + """ + + # output + content = dict() + + search_engine = arxiv.Search( + query = query, + max_results = max_results, + sort_by = arxiv.SortCriterion.SubmittedDate + ) + + for result in search_engine.results(): + + paper_id = result.get_short_id() + paper_title = result.title + paper_url = result.entry_id + + paper_abstract = result.summary.replace("\n"," ") + paper_authors = get_authors(result.authors) + paper_first_author = get_authors(result.authors,first_author = True) + primary_category = result.primary_category + + publish_time = result.published.date() + + print("Time = ", publish_time , + " title = ", paper_title, + " author = ", paper_first_author) + + # eg: 2108.09112v1 -> 2108.09112 + ver_pos = paper_id.find('v') + if ver_pos == -1: + paper_key = paper_id + else: + paper_key = paper_id[0:ver_pos] + + content[paper_key] = f"|**{publish_time}**|**{paper_title}**|{paper_first_author} et.al.|[{paper_id}]({paper_url})|\n" + data = {topic:content} + + return data + + +if __name__ == "__main__": + + data_collector = [] + keywords = dict() + keywords["SLAM"] = "SLAM" + + for topic,keyword in keywords.items(): + + print("Keyword: " + topic) + data = get_daily_papers(topic, query = keyword, max_results = 10) + data_collector.append(data) + print("\n") + + + diff --git a/pass b/pass new file mode 100644 index 0000000..b974018 --- /dev/null +++ b/pass @@ -0,0 +1,4 @@ +wW5gVm+DjTU.WV~ +anonpublic:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InlpZGZ1a2Zicmx1aXpqdmZycnNqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDQ4NjMyNjEsImV4cCI6MjAyMDQzOTI2MX0.EXIXAdNIGLFo5wHmwmY2-9bqLO9vyFYDvMMtCtkxgig + +service_role: \ No newline at end of file