Skip to content

Commit

Permalink
Merge pull request #115 from mimotej/add-new-url-to-handle
Browse files Browse the repository at this point in the history
fix: Add additional option for links to dspace
  • Loading branch information
mimotej authored Jul 22, 2024
2 parents 13b0cc4 + 0116428 commit ec4ea97
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.11
rev: v1.5.5
hooks:
- id: remove-tabs

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
Expand All @@ -18,7 +18,7 @@ repos:
args: [--allow-multiple-documents]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.13.0
rev: v9.7.0
hooks:
- id: eslint
additional_dependencies:
Expand All @@ -29,7 +29,7 @@ repos:
- "[email protected]"

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1
rev: v4.0.0-alpha.8
hooks:
- id: prettier
files: \.[jt]s$
2 changes: 1 addition & 1 deletion src/commands/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const data = new SlashCommandBuilder()
option
.setName('bachelorthesislink')
.setDescription(
'Thesis link at Dspace (example URL: https://dspace.vutbr.cz/handle/11012/478521)'
'Thesis link at Dspace (example URL: https://dspace.vutbr.cz/handle/cby7-11b-4d4-9f79f-d98bee82)'
)
.setRequired(true)
);
Expand Down
9 changes: 8 additions & 1 deletion src/utils/scrapeThesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ export async function scrapeThesis(bachelorThesisPath: string) {
);
} catch (e) {
console.debug(e);
return null;
try {
response = await axios.get(
'https://hdl.handle.net' + bachelorThesisPath
);
} catch (error) {
console.debug(error);
return null;
}
}
const $ = load(response.data);
console.log('LOG: Parsing author name from the page.');
Expand Down

0 comments on commit ec4ea97

Please sign in to comment.