Skip to content

Added "unpaywall" command as per issue 131#282

Open
lukawarren wants to merge 1 commit intoUWCS:masterfrom
lukawarren:issue-131-unpaywall
Open

Added "unpaywall" command as per issue 131#282
lukawarren wants to merge 1 commit intoUWCS:masterfrom
lukawarren:issue-131-unpaywall

Conversation

@lukawarren
Copy link
Copy Markdown
Contributor

Doesn't detect pay-walled content yet, but does automate generation of the URLs. I think outline is dead, so replaced with archive.org. See #131

"""Generate alternative links for bypassing paywalls."""
services = {
"🔓 12ft.io": f"https://12ft.io/{url}",
"📅 Web Archive": f"https://web.archive.org/web/{url}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add archive.is here too http://archive.is/newest/{url}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12ft.io seems dead, replace with an alternative

@commands.hybrid_command(help=LONG_HELP_TEXT, brief=SHORT_HELP_TEXT)
async def unpaywall(self, ctx: Context, url: str):
if not url.startswith("http") and not url.startswith("https"):
await ctx.send("Please provide a valid URL.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a return here, if an invalid URL is provided it will send the error AND the bogus links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants