Advice for adding date
Thank you for this plugin! I would like to modify this to automatically download the date that the paper was published. I have experience programming, but I don't have much experience with JavaScript or using the Notion API. Do you have suggestions for how to get started (e.g., files/lines I need to modify) to make this modification? I'd be happy to make a PR for this if I finish this.
@vitchyr
Hi, I would like to share some information to extend this extension. (I hope this information would also help other users)
How to debug your extension
- change this line to the following https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/popup.js#L19
- this will query arxiv information not from the current tab data but from the hard-coded URL.
- this.getCurrentTabUrl();
+ this.getPaperInfo(TEST_URL);
$ npm install & npm run buildbuild the extension locally- navigate to
chrome://extension- turn on
developer mode - select
load unpackedand openarxiv2notion/dist - you can see the extension ID like
aedplelmaaaldilfkeobdapccljxxxxxin the loaded extension description - open
chrome-extension://aedplelmaaaldilfkeobdapccljxxxxx/popup.html
- turn on
- open chrome developer tools in your browser (
Ctrl + Shift + iw/Linux)- you can see debugging outputs (\eg
console.log()) in the devtools.
- you can see debugging outputs (\eg
- once you
load unpacked, the extension is automatically synced whenever you runnpm run buildand reloadchrome-extension://${your-extension-id}/popup.html - you will be able to know more about how everything is working.

Change Notion database scheme
- If you attempt to add a new column like
published date, you need to add it in your notion.so manually https://github.com/denkiwakame/arxiv2notion#getting-started or via Notion API https://developers.notion.com/reference/update-a-database
Get arXiv published date
- To retrieve arXiv paper information, this extension utilizes arXiv public API.
- You can see properties available in the current API https://arxiv.org/help/api/basics
- For example, if you need
published, you can add some code to obtain the target property.- https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/popup.js#L112-L124
const published = entry.querySelector("published").textContent;
- The retrieved contents will be posted by this line https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/popup.js#L49
- Thus you need to add properties to https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/popup.js#L127
Post to notion.so
- Add property to https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/notion.js#L62-L118
- You may need to follow the Notion API date format. https://developers.notion.com/reference/page#date-property-values
- I haven't tested though, maybe like this ?
Published: {
id: "published",
type: "date",
date: { start: "2020-12-08T12:00:00Z", end: null },
},
Oh, wait, when I finished up writing this, I realized that customizing this extension is somewhat troublesome. :skull_and_crossbones: I designed the default database scheme simplest so that it would meet the demand for diversified potential users. I will be considering to update this extension so that the user can select properties on-demand without coding. If you don't mind, could you please give me some feedback on the desired properties (database scheme) or UIs to save on notion.so ?
Merged: https://github.com/denkiwakame/arxiv2notion/pull/6