Skip to content

Commit

Permalink
feat: Support navigate from HuggingFace
Browse files Browse the repository at this point in the history
  • Loading branch information
j3soon committed Aug 4, 2024
1 parent b4e0f76 commit 8096f62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions chrome/target_url_regexp_replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default [
[/^.*:\/\/(?:export\.|browse\.|www\.)?arxiv\.org\/ftp\/(?:arxiv\/|([^\/]*\/))papers\/.*?([^\/]*?)\.pdf(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1$2"],
[/^.*:\/\/(?:browse\.|www\.)?arxiv\.org\/html\/(\S*?)\/*(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1"],
[/^.*:\/\/ar5iv\.labs\.arxiv\.org\/html\/(\S*?)\/*(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1"],
[/^.*:\/\/huggingface\.co\/papers\/(\S*?)(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1"],
[/^.*:\/\/openreview\.net\/forum\?(?:.*?&)?id=(\S*?)(&.*?)?(\#.*?)?$/, "https://openreview.net/pdf?id=$1"],
[/^.*:\/\/openreview\.net\/pdf\?(?:.*?&)?id=(\S*?)(&.*?)?(\#.*?)?$/, "https://openreview.net/forum?id=$1"],
// Starting from 2022, NIPS urls may end with a `-Conference` suffix
Expand Down
1 change: 1 addition & 0 deletions firefox/target_url_regexp_replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default [
[/^.*:\/\/(?:export\.|browse\.|www\.)?arxiv\.org\/ftp\/(?:arxiv\/|([^\/]*\/))papers\/.*?([^\/]*?)\.pdf(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1$2"],
[/^.*:\/\/(?:browse\.|www\.)?arxiv\.org\/html\/(\S*?)\/*(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1"],
[/^.*:\/\/ar5iv\.labs\.arxiv\.org\/html\/(\S*?)\/*(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1"],
[/^.*:\/\/huggingface\.co\/papers\/(\S*?)(\?.*?)?(\#.*?)?$/, "https://arxiv.org/abs/$1"],
[/^.*:\/\/openreview\.net\/forum\?(?:.*?&)?id=(\S*?)(&.*?)?(\#.*?)?$/, "https://openreview.net/pdf?id=$1"],
[/^.*:\/\/openreview\.net\/pdf\?(?:.*?&)?id=(\S*?)(&.*?)?(\#.*?)?$/, "https://openreview.net/forum?id=$1"],
// Starting from 2022, NIPS urls may end with a `-Conference` suffix
Expand Down
12 changes: 8 additions & 4 deletions tests/testcases/testcases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ navigation:
url2: https://arxiv.org/abs/1512.03385
title2: Deep Residual Learning for Image Recognition | Abstract
description: ar5iv -> arXiv
- url: https://huggingface.co/papers/2408.00714
title: "Paper page - SAM 2: Segment Anything in Images and Videos"
url2: https://arxiv.org/abs/2408.00714
title2: "SAM 2: Segment Anything in Images and Videos | Abstract"
description: ar5iv -> arXiv
- url: https://openreview.net/pdf?id=LcF-EEt8cCC
url2: https://openreview.net/forum?id=LcF-EEt8cCC
title2: Denoising Likelihood Score Matching for Conditional Score-based Data Generation | OpenReview
Expand Down Expand Up @@ -321,11 +326,10 @@ navigation:
pdf_url: https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=10412086
skip_selenium: True # skipped due to paywall
description: IEEE
- url: https://ieeexplore.ieee.org/document/10412086
pdf_url: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=10412086&tag=1
abs2pdf: False
- url: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=10412086&tag=1
url2: https://ieeexplore.ieee.org/document/10412086
skip_selenium: True # skipped due to paywall
description: IEEE (with extra query strings)
description: IEEE pdf -> abs (with extra query strings)

# TODO: Test download filenames:
# - Title with colon: https://arxiv.org/abs/2102.07936
Expand Down

0 comments on commit 8096f62

Please sign in to comment.