Commit Graph

11464 Commits

Author SHA1 Message Date
Valentin Lorentz
0bfd82f650 DDG: Add missing copyright notice. 2020-05-15 21:36:31 +02:00
Valentin Lorentz
d05b6e120b DDG: Remove note about dependency on BeautifulSoup. 2020-05-15 21:35:16 +02:00
Valentin Lorentz
10df0a0dd0 DDG: Rewrite using html.parser.HTMLParser instead of BeautifulSoup.
So we don't depend on an external library.
2020-05-15 21:26:44 +02:00
Valentin Lorentz
37c1fa2153 DDG: add test 2020-05-15 21:24:43 +02:00
Valentin Lorentz
5e90044fab DDG: Make tests honor --no-network. 2020-05-15 21:24:01 +02:00
James Lu
db184f962b Merge DDG plugin from my repository
Add 'plugins/DDG/' from commit '410b51657aeb93b4836d62168a90b319677a45f1'

git-subtree-dir: plugins/DDG
git-subtree-mainline: 91381aec0f
git-subtree-split: 410b51657a
2020-05-15 11:32:43 -07:00
James Lu
91381aec0f .mailmap: update my email
[skip ci]
2020-05-15 11:28:09 -07:00
James Lu
410b51657a Update plugin author/maintainer data
From: cbd953b32c
2020-05-15 11:19:32 -07:00
James Lu
e44083f9a5 Update my email & repo link references
From: 2ae51939b3
2020-05-15 11:19:32 -07:00
James Lu
c99353106e Annotate READMEs with BeautifulSoup dependencies
From: a80a19564c
2020-05-15 11:19:32 -07:00
James Lu
8689345f74 DDG: remove zeroclick from plugin readme
[skip ci]

From: 3ab4ba16dc
2020-05-15 11:19:32 -07:00
James Lu
c73542fb3f DDG: remove the 'zeroclick' command
The IRC output is poorly formatted, and doesn't yield useful results most of the time anyways.

From: cdf6c7eb3e
2020-05-15 11:19:32 -07:00
James Lu
e4d16257b6 DDG: support !bang links (redirects)
From: 1e7bfed72e
2020-05-15 11:19:32 -07:00
James Lu
ba04480405 DDG: rewrite _ddgurl() to return new and original request URLs
This uses utils.web.getUrlTargetAndContent(), which is specific to Limnoria and requires commit ProgVal/Limnoria@57b77a6725 or later

From: 2db371a9fa
2020-05-15 11:19:32 -07:00
James Lu
53318d142c DDG: show all lines of multiline zeroclick replies
Thanks to @nathan0 for pointing this out.

From: 0b0c1b59ab
2020-05-15 11:19:32 -07:00
James Lu
f5a53a1965 DDG: actually, return a list of tuples in search_core()
This abstraction makes it easier for depending plugins to filter out the data they actually need.

From: 4915b7713b
2020-05-15 11:19:32 -07:00
James Lu
828112eaa1 DDG: fix a typo in comments
From: 3729068633
2020-05-15 11:19:32 -07:00
James Lu
48b5016f41 DDG: rewrite to fix "max results" not working
From: 7a6e2f9f97
2020-05-15 11:19:32 -07:00
James Lu
30615a7284 DDG: abstract out a search_core(), as the LastFM plugin will use this later
From: 47bb74d7d9
2020-05-15 11:19:32 -07:00
James Lu
44b626df64 DDG: make _ddgurl() a static method
From: d332e73e48
2020-05-15 11:19:32 -07:00
James Lu
c92bc0ca0c DDG: expand redirect links in search results
Some links on DuckDuckGo's site are now shown going through a redirect service.
These links are in the format "/l/?kh=-1&uddg=https%3A%2F%2Fduckduckgo.com%2F" instead of simply being "https://duckduckgo.com", and we should decode these here.

From: 8187d51cef
2020-05-15 11:19:32 -07:00
James Lu
98600b26e8 DDG: fix wrong command name in README
[skip ci]
From: 22a4fb457d
2020-05-15 11:19:32 -07:00
James Lu
1806646be2 plugins: update my email
From: 177eefa0a3
2020-05-15 11:19:32 -07:00
James Lu
f9b83ac2de DDG: log search URL to DEBUG
From: 5431f25e0a
2020-05-15 11:19:32 -07:00
James Lu
950aec696e DDG: remove broken error catching (irc isn't in the _ddgurl namespace)
From: 52ec05a041
2020-05-15 11:19:32 -07:00
James Lu
35677548df DDG: strip Sponsored links from search results
From: e9edceb735
2020-05-15 11:19:32 -07:00
Valentin Lorentz
f8a14547f9 Google: Update regexp. 2020-05-15 19:56:36 +02:00
Valentin Lorentz
ddce09d257 Rename supybot.reply.format.databaseRecord to supybot.replies.databaseRecord. 2020-05-15 19:08:43 +02:00
Valentin Lorentz
376917b1b8 Fediverse: Show attachment URLs. 2020-05-15 18:51:19 +02:00
Valentin Lorentz
3d1e88cb68 safeEval: Get rid of eval().
It should be safe considering the AST sanity checks,
but I don't see any point in keeping it.
2020-05-15 18:31:04 +02:00
Valentin Lorentz
6f4e3a2dbd QuoteGrabs: Add support for +draft/reply to point to the message to grab. 2020-05-15 18:17:34 +02:00
Valentin Lorentz
a54db1034f Fix Python 3.4 support. 2020-05-14 21:49:56 +02:00
Valentin Lorentz
eaf7222509 Fediverse: Cache host support for webfinger before snarfing.
This is much cheaper both for us and the host if the host
doesn't support activitypub at all (which is what happens
most of the time).
2020-05-14 21:33:34 +02:00
Valentin Lorentz
566920070c Fix regressions in 4046a1b201. 2020-05-14 19:00:31 +02:00
Valentin Lorentz
7444e656d8 supybot.reply.format.databaseRecord: Add $nick 2020-05-14 18:56:20 +02:00
Valentin Lorentz
4046a1b201 ChannelIdDatabasePlugin: Make the format of showRecord() configurable. 2020-05-14 18:45:04 +02:00
Valentin Lorentz
dc736799b8 callbacks: Prevent passing 'value' as positional argument to registryValue.
In case we need to add other arguments in the future.
2020-05-14 18:43:54 +02:00
Valentin Lorentz
9e57913674 plugins/__init__.py: internationalize strings. 2020-05-14 18:42:22 +02:00
Valentin Lorentz
0c6b526fdd Add -scheduler.repeat to default capabilities.
It's too easy to use to flood.
2020-05-13 20:16:35 +02:00
Valentin Lorentz
e90b89f5b2 Owner: Honor supybot.reply.error.detailed on command syntax errors. 2020-05-13 19:58:06 +02:00
Valentin Lorentz
a9eb31f1b5 Scheduler: Preserve network across restarts. 2020-05-12 18:32:37 +02:00
Valentin Lorentz
27edb4f6c9 Fediverse: Lower timeout of networkless tests.
There are many calls to assertSnarfNoResponse, so there's a lot
of time wasted sleeping, while these commands are fast enough
to answer in less than 0.1s
2020-05-10 21:42:41 +02:00
Valentin Lorentz
dc2fe4d5f3 Fediverse: Deduplicate username formatting and add some error handling. 2020-05-10 21:39:15 +02:00
Valentin Lorentz
2c9e6544f5 Fediverse: Add @status. 2020-05-10 21:12:05 +02:00
Valentin Lorentz
4e74c6dbb3 Fediverse: Make URL snarfer take precedence over Web. 2020-05-10 16:19:13 +02:00
Valentin Lorentz
6ea8b6bb31 Fediverse: Move test data to its own module. 2020-05-10 15:11:10 +02:00
Valentin Lorentz
d1854cfc9b Fediverse: Add URL snarfer. 2020-05-10 14:52:55 +02:00
Valentin Lorentz
5908b86635 Fediverse: Add option format.statuses.showContentWithCW 2020-05-10 13:37:40 +02:00
Valentin Lorentz
a52e7fa91b Fediverse: Show content warnings. 2020-05-10 13:04:01 +02:00
Valentin Lorentz
7511984a60 Fediverse: Fix compatibility with Python 3.4 and 3.5. 2020-05-10 11:21:08 +02:00