chiark / gitweb /
Matthew Vernon [Wed, 20 Apr 2022 13:23:27 +0000 (14:23 +0100)]
remove {black,white}list trout/flirt
Matthew Vernon [Sun, 11 Jul 2021 13:03:13 +0000 (14:03 +0100)]
new trout from rejs ( https://bbc.co.uk/news/av/world-us-canada-
57793082 )
Matthew Vernon [Wed, 19 May 2021 15:58:25 +0000 (16:58 +0100)]
new slash from rejs
Matthew Vernon [Wed, 19 May 2021 15:58:00 +0000 (16:58 +0100)]
new flirt from rejs
Matthew Vernon [Wed, 19 May 2021 15:57:40 +0000 (16:57 +0100)]
new trouts from rejs
Matthew Vernon [Thu, 18 Mar 2021 12:39:34 +0000 (12:39 +0000)]
new trout from rejs (
https://www.theguardian.com/world/2021/mar/18/taiwan-official-urges-people-to-stop-changing-their-name-to-salmon )
Matthew Vernon [Wed, 3 Feb 2021 15:20:57 +0000 (15:20 +0000)]
new trout from jtn (inspired by the goat-on-zoom service)
Matthew Vernon [Fri, 22 Jan 2021 18:40:19 +0000 (18:40 +0000)]
new trout from jtn
Matthew Vernon [Fri, 22 Jan 2021 12:16:37 +0000 (12:16 +0000)]
new trout from jtn
Matthew Vernon [Fri, 4 Sep 2020 15:34:24 +0000 (16:34 +0100)]
new trout from jtn & ceb https://theguardian.com/world/2020/sep/04/rare-sturgeon-fish-found-preserved-in-danish-ship-that-sank-in-1495
Matthew Vernon [Tue, 1 Sep 2020 12:48:09 +0000 (13:48 +0100)]
new trout/flirt from rjk (George 3, in Hamilton)
Matthew Vernon [Mon, 20 Jul 2020 14:52:05 +0000 (15:52 +0100)]
new trout from Diziet
Matthew Vernon [Sun, 19 Jul 2020 20:34:27 +0000 (21:34 +0100)]
new trouts from rejs
Matthew Vernon [Thu, 11 Jun 2020 17:40:59 +0000 (18:40 +0100)]
new trout from fanf
Matthew Vernon [Fri, 1 May 2020 15:09:35 +0000 (16:09 +0100)]
new flirt from rejs (in the time of COVID-19)
Matthew Vernon [Fri, 27 Mar 2020 17:54:47 +0000 (17:54 +0000)]
remove objected-to flirt
Matthew Vernon [Wed, 4 Mar 2020 14:56:24 +0000 (14:56 +0000)]
new trout from ceb (https://en.wikipedia.org/wiki/Francis_of_Paola#Legends)
Matthew Vernon [Wed, 15 Jan 2020 17:26:42 +0000 (17:26 +0000)]
new trout from jtn (rising bollards, anyone?)
Matthew Vernon [Wed, 20 Nov 2019 16:53:44 +0000 (16:53 +0000)]
new trout from jtn (with edit from Diziet)
Matthew Vernon [Wed, 20 Nov 2019 14:52:31 +0000 (14:52 +0000)]
new trout from ceb
Matthew Vernon [Tue, 12 Nov 2019 11:59:03 +0000 (11:59 +0000)]
new trout from Emperor inspired by jpmg
Matthew Vernon [Thu, 3 Oct 2019 21:31:55 +0000 (22:31 +0100)]
new flirts from rejs
Matthew Vernon [Thu, 3 Oct 2019 21:31:39 +0000 (22:31 +0100)]
new trout from rejs
Matthew Vernon [Tue, 9 Jul 2019 15:09:19 +0000 (16:09 +0100)]
new trout from Emperor
Matthew Vernon [Tue, 9 Jul 2019 15:08:56 +0000 (16:08 +0100)]
New trout from pm215
Matthew Vernon [Wed, 3 Jul 2019 14:05:47 +0000 (15:05 +0100)]
Correct markup errors in doc - close <span> with </span>
Jacob Nevins [Wed, 3 Jul 2019 11:39:53 +0000 (12:39 +0100)]
Document new ~blame syntax added in
5b81b760d2.
Tom Womack [Wed, 26 Jun 2019 20:34:53 +0000 (21:34 +0100)]
Parse video objects less stoatily
The https://github.com/bear/python-twitter API throws away the
extended-information field in which the name of the video file is stored;
so parse the JSON again ourselves to get hold of it.
Pick the highest bit rate MP4 video.
Throw away the old ad-hoc mangling of video_thumb urls; that is no
longer needed.
Signed-off-by: Tom Womack <tom@womack.net>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
---
v2:
Fix logic error:
When tweet contains multiple media, handle videos as videos and
non-videos as non-videos. Resulting patch has rather different
organisation and does less violence to the original code.
Commit message changes:
Mention deletion of tweet_video_thumb hack
Style fixes and changes:
Do not add a comment about the new import
Use .get(DEFVAL) rather than nesting in if KEY in VAL, throughout
Reformat new comment about JSON parsing to 80 columns
Use ' rather than " for protocol elements such as hash keys
Use split rather than a regexp to trim ? part from url
Comments say "we" do something, not "I".
When searching for the best, have a single `best' variable
Divide float by float not int
Adjust new replacement string construction to be more natural
Be consistent about spaces around ==
Ian Jackson [Wed, 26 Jun 2019 20:34:12 +0000 (21:34 +0100)]
coding style: Whitespace fixes in tweet handling
Remove unidiomatic spaces inside ( ).
Remove a blank line in an unusual place.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 30 May 2019 11:03:31 +0000 (12:03 +0100)]
blame: Allow `~blame #last 2' etc.
Ie,
~blame #last 1 = ~blame #last
~blame #last 2 = the last-but-one fish
~blame #last 3 = the last-but-two fish
etc.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
---
v2: Fixed off-by-one error in commit message.
Ian Jackson [Thu, 30 May 2019 10:50:51 +0000 (11:50 +0100)]
blame: Remember last 10 trouts, not just 1
No functional change yet.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
---
v2: Fixed wrong-end error in array manipulation.
Ian Jackson [Thu, 30 May 2019 10:31:35 +0000 (11:31 +0100)]
blameq: Rename fish variable to fishpond
This is now always an instance of FishPond. Using the same name as
elsewhere in commands.py is less confusing.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 30 May 2019 10:29:15 +0000 (11:29 +0100)]
blame: Move .last* update into a method
The code in troutq and blameq is very clone and hack. This change
reduces it very slightly so that I can make my next change in only one
place.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 30 May 2019 10:49:01 +0000 (11:49 +0100)]
Make class vars into instance vars
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 30 May 2019 10:28:18 +0000 (11:28 +0100)]
FishPond: Actually make fish be an instance object (in other bots)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 30 May 2019 10:25:23 +0000 (11:25 +0100)]
FishPond: Actually make fish be an instance object (in Servus)
OMG.
No overall functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 30 May 2019 10:13:40 +0000 (11:13 +0100)]
FishPond: Use in all other bots
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 30 May 2019 10:08:23 +0000 (11:08 +0100)]
FishPond: introduce new class and use in Servus-chiark
The configuration class `fish' appears in every bot, but it also
contains initial values of state variables used by the implementation.
Move those into their own class, and make it a base class of
Servus-chiark's pond. Since we are duck typing, it is OK to not yet
update the other bots.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 29 May 2019 14:19:03 +0000 (15:19 +0100)]
blame: Print the filename with blame #last
In principle we could have got this from "git blame" but (1) that
makes parsing this more annoying and (2) by rights this should come
from the fish cfg so that it can be a display name at some point.
The main effect is to print something like:
13:41 <Servus> Modified flirts 2011-05-31: new fish from Alice
rather than:
13:41 <Servus> Modified 2011-05-31: new fish from Alice
I have not taken the trouble to touch the three open-coded special
cases for blame #trouts etc. I thought that was beyond the call of
duty. In those cases it will print:
13:41 <Servus> Modified fish? 2011-05-31: new fish from Alice
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 29 May 2019 14:18:18 +0000 (15:18 +0100)]
blame: Put the filename in the loadblame result
We are going to use this to say what kind of fish it was, in
~blame #last.
We also need to change the two places where this is destructured.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 29 May 2019 14:11:27 +0000 (15:11 +0100)]
blame #last: Blame the right thing
Previously this would search all the blame databases. This is wrong,
it should search the one corresponding to the last fish. Now that we
have last_cfg, and the db info is in the cfg, we can do that.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 29 May 2019 14:05:56 +0000 (15:05 +0100)]
blame: Move blame db information into the cfg
These should never have been separate.
We abolish the ad-hoc tbdb, fbdbk etc. variables. Instead, we put
this all in the cfg. It is OK to extend the cfg since the code does
not destructure it but instead always indexes it. So bot instances
without blame will not mind.
blameq needs to fish it out again for the benefit of the open-coded
conditions on "#trouts" etc. I'm not fixing that right now.
The deleted lines like this
tbdb,tbdbk=loadblame("trouts")
have different variable names than the inserted lines like this
tdb,tdbk = cfgs[0][7]
because, unaccountably, the global variable names are different to
the local variables inside blameq.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 29 May 2019 13:55:06 +0000 (14:55 +0100)]
fish: Pass cfgs to blameq
This open-coding of three separate things, with blameq having magic
knowledge of which one is which, is completely wrong. blameq should
take a list. The various Xdb Xdbk should in the cfgs too.
A step towards this is for blameq to get the cfgs.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 29 May 2019 13:50:03 +0000 (14:50 +0100)]
fish: track last_cfg too
No-one uses this yet. So no functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Matthew Vernon [Tue, 14 May 2019 13:25:48 +0000 (14:25 +0100)]
new flirt from Emperor (apropos remarks made about a cyclist)
Matthew Vernon [Wed, 3 Apr 2019 13:54:14 +0000 (14:54 +0100)]
new trout from jtn ( https://theoatmeal.com/comics/idiocy )
Matthew Vernon [Wed, 27 Feb 2019 14:32:45 +0000 (14:32 +0000)]
new trouts from rejs
Matthew Vernon [Wed, 27 Feb 2019 14:32:19 +0000 (14:32 +0000)]
new flirts from rejs
Matthew Vernon [Tue, 5 Feb 2019 09:20:56 +0000 (09:20 +0000)]
new trout from jtn
Matthew Vernon [Thu, 31 Jan 2019 15:37:52 +0000 (15:37 +0000)]
new trout from jtn
Matthew Vernon [Thu, 17 Jan 2019 18:01:50 +0000 (18:01 +0000)]
Output the date of first mention, not the current date
...this is in the code path where the URL was mentioned on a previous
date, so we should output the date of first mention (self.localfirst)
not the current date (n).
Matthew Vernon [Thu, 10 Jan 2019 19:29:12 +0000 (19:29 +0000)]
new trout from chelgrian (no, not the album by Bride)
Matthew Vernon [Tue, 11 Dec 2018 16:34:31 +0000 (16:34 +0000)]
strip more garbage out of twitter urls (esp the ?s=[:digits:]) tracking code - thanks cjwatson
Matthew Vernon [Wed, 28 Nov 2018 20:36:22 +0000 (20:36 +0000)]
Add blame-filtering
This simply works on the md5 of the offending commit message, and
replaces it with new text.
blame_filter.py is a simple dictionary of md5: replacement pairs; it
is not committed itself (and is ignored by git)
Matthew Vernon [Mon, 10 Dec 2018 16:30:35 +0000 (16:30 +0000)]
0-pad times (so 13:03 rather than 13:3)
Matthew Vernon [Fri, 23 Nov 2018 15:04:26 +0000 (15:04 +0000)]
New trout from Diziet (apropos what 🔥 looks like)
Matthew Vernon [Wed, 14 Nov 2018 11:17:29 +0000 (11:17 +0000)]
Correct tyop in flirt from rjk
Matthew Vernon [Fri, 9 Nov 2018 17:12:14 +0000 (17:12 +0000)]
new flirt from Diziet
Matthew Vernon [Thu, 8 Nov 2018 19:00:48 +0000 (19:00 +0000)]
Adjust url-observation, per chiark.irc discussion
Servus now describes URLs without adjective, as these were felt to be
discouraging. Further, it won't mention a URL within 5 minutes of its
previous mention. Time is now given as a timestamp, rather than the
"about X minutes/hours ago"
Matthew Vernon [Wed, 7 Nov 2018 19:35:54 +0000 (19:35 +0000)]
Don't remark on URLs that are repeated after a short period
If a URL has been mentioned in the recent past, then it'll be
obviously visible in-channel, and it was probably a mistake
(e.g. mentioning a URL you meant to ~twit), so no need to comment on
it.
Ian Jackson [Thu, 25 Oct 2018 16:26:14 +0000 (17:26 +0100)]
url observations: Rename `urlcomplaints' variable to `urlinfos'
These are no longer complaints.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Conflicts:
commands.py
Matthew Vernon [Wed, 7 Nov 2018 19:17:56 +0000 (19:17 +0000)]
url observations: make the "complaints" less complainy
Based on Ian Jackson's re-wording, but tweaked a little to suit my
taste better.
Ian Jackson [Thu, 25 Oct 2018 16:04:44 +0000 (17:04 +0100)]
main: Drop daft try/expect
This serves only to obfuscate. The result is that, for example, if
you don't have the twitter module, you get this error message:
acrobat: configuration module Servus-chiark.py not found
which is a lie.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Matthew Vernon [Wed, 10 Oct 2018 16:16:29 +0000 (17:16 +0100)]
Remove trout in light of objections
Matthew Vernon [Mon, 24 Sep 2018 15:37:30 +0000 (16:37 +0100)]
new trout from rjk
Matthew Vernon [Tue, 28 Aug 2018 12:45:30 +0000 (13:45 +0100)]
new flirt from Emperor (SatW board game)
Matthew Vernon [Tue, 21 Aug 2018 15:47:07 +0000 (16:47 +0100)]
correct typo (missing : )
Jonathan David Amery [Tue, 14 Aug 2018 20:01:06 +0000 (21:01 +0100)]
Add a limit to tweet expansion recursion.
Signed-off-by: Matthew Vernon <matthewv@chiark.greenend.org.uk>
Jonathan David Amery [Tue, 14 Aug 2018 11:05:10 +0000 (12:05 +0100)]
Add exemplar servus_twapi_oauth.txt file.
Signed-off-by: Matthew Vernon <matthewv@chiark.greenend.org.uk>
Jonathan David Amery [Tue, 14 Aug 2018 11:05:09 +0000 (12:05 +0100)]
With the new embedded tweet code there's no reason not to expand embedded tweets inside embedded tweets.
Signed-off-by: Matthew Vernon <matthewv@chiark.greenend.org.uk>
Jonathan David Amery [Tue, 14 Aug 2018 11:05:08 +0000 (12:05 +0100)]
Fix for embedded tweet support:
Problem:
* Overly long embedded tweets cause Acrobat to go over the server's
line length limit which causes the message to be silently discarded
because of a lack of error handling in automsg.
Solutions:
* Make each tweet in an embedded tweet chain a seperate message
- this requires getTweet to now return a list
* Did not fix automsg at all
Signed-off-by: Matthew Vernon <matthewv@chiark.greenend.org.uk>
Matthew Vernon [Mon, 11 Jun 2018 12:29:53 +0000 (13:29 +0100)]
new flirts from rejs
Matthew Vernon [Mon, 11 Jun 2018 12:29:31 +0000 (13:29 +0100)]
new trouts from rejs
Matthew Vernon [Sat, 28 Apr 2018 21:20:34 +0000 (22:20 +0100)]
New trouts from rjk
Matthew Vernon [Tue, 10 Apr 2018 15:16:47 +0000 (16:16 +0100)]
new trout from Emperor (based on previous)
Matthew Vernon [Tue, 10 Apr 2018 15:16:28 +0000 (16:16 +0100)]
new trout from rjk
Matthew Vernon [Thu, 1 Mar 2018 15:47:12 +0000 (15:47 +0000)]
new trouts from rjk
Matthew Vernon [Wed, 28 Feb 2018 14:57:55 +0000 (14:57 +0000)]
new flirt from jtn
Matthew Vernon [Fri, 16 Feb 2018 16:14:06 +0000 (16:14 +0000)]
new trout from jtn
Matthew Vernon [Thu, 8 Feb 2018 20:23:17 +0000 (20:23 +0000)]
new flirts from rejs
Matthew Vernon [Thu, 8 Feb 2018 20:23:00 +0000 (20:23 +0000)]
new trouts from rejs
Matthew Vernon [Sun, 14 Jan 2018 17:10:44 +0000 (17:10 +0000)]
New trouts from jtn
Matthew Vernon [Mon, 8 Jan 2018 11:25:39 +0000 (11:25 +0000)]
New trout from adam
Matthew Vernon [Mon, 1 Jan 2018 17:48:25 +0000 (17:48 +0000)]
New trout from Midwinter
Matthew Vernon [Thu, 30 Nov 2017 18:04:52 +0000 (18:04 +0000)]
New flirt from jtn (after fivemack)
Matthew Vernon [Thu, 26 Oct 2017 10:06:47 +0000 (11:06 +0100)]
new trout from rjk
Matthew Vernon [Thu, 12 Oct 2017 07:08:28 +0000 (08:08 +0100)]
new trout from jtn [https://en.wikipedia.org/wiki/Paperclip_maximizer]
Matthew Vernon [Fri, 15 Sep 2017 10:04:19 +0000 (11:04 +0100)]
new trout from rjk
Matthew Vernon [Wed, 6 Sep 2017 08:26:08 +0000 (09:26 +0100)]
new trout from adam (bbc.co.uk/news/uk-england-bristol-
41167296)
Matthew Vernon [Tue, 5 Sep 2017 08:36:16 +0000 (09:36 +0100)]
new trout from jtn
Matthew Vernon [Mon, 4 Sep 2017 15:36:58 +0000 (16:36 +0100)]
new trouts from rejs
Matthew Vernon [Thu, 27 Jul 2017 16:18:58 +0000 (17:18 +0100)]
new trout from rjk
Matthew Vernon [Wed, 21 Jun 2017 15:35:51 +0000 (16:35 +0100)]
New trout from Emperor
Matthew Vernon [Wed, 31 May 2017 15:11:36 +0000 (16:11 +0100)]
new trout from Diziet
Matthew Vernon [Wed, 8 Mar 2017 16:15:59 +0000 (16:15 +0000)]
New trout from rjk
Matthew Vernon [Mon, 16 Jan 2017 16:12:57 +0000 (16:12 +0000)]
new trout from rjk (ref Alt-J song)
Matthew Vernon [Sun, 15 Jan 2017 22:37:53 +0000 (22:37 +0000)]
new flirt from fivemack
Matthew Vernon [Tue, 10 Jan 2017 22:35:21 +0000 (22:35 +0000)]
new flirt from rejs
Matthew Vernon [Tue, 10 Jan 2017 22:35:01 +0000 (22:35 +0000)]
new trouts from rejs
Matthew Vernon [Wed, 4 Jan 2017 17:06:24 +0000 (17:06 +0000)]
New trout from Emperor (improved by ceb)