Author Topic: Deletion of two sub-boards  (Read 2684 times)

rogerzilla

  • When n+1 gets out of hand
Deletion of two sub-boards
« on: 14 May, 2018, 12:56:56 pm »
The LEL 2017 and HAMR boards are so last year, dahling, and will be rolled back into the main Audax board at the weekend.  You'll also see that a PBP 2019 board has appeared.

I appreciate that some posts make less sense out of the context of a pure LEL or HAMR board but I don't have an automated way to prefix hundreds of posts with [LEL] or [HAMR].  If anyone wants to volunteer for an hour's donkey work, PM me quickly!
Hard work sometimes pays off in the end, but laziness ALWAYS pays off NOW.

Re: Deletion of two sub-boards
« Reply #1 on: 14 May, 2018, 09:21:28 pm »
I'll be prefixing with [LEL17] and [HAMR] over the next couple of days.

I'll also create a single post with links to each subject that we can sticky if required (and/or link to from one of the FAQ posts).
"Yes please" said Squirrel "biscuits are our favourite things."

Kim

  • Timelord
    • Fediverse
Re: Deletion of two sub-boards
« Reply #2 on: 14 May, 2018, 11:58:47 pm »
Chapeau!

Re: Deletion of two sub-boards
« Reply #3 on: 15 May, 2018, 08:41:49 am »
LEL17 done: https://yacf.co.uk/forum/index.php?topic=108003.0

That took an hour or so, so I guess HAMR will take 2-3 hours. Will chip away at it over the day.

Click click click.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Deletion of two sub-boards
« Reply #4 on: 15 May, 2018, 10:40:00 am »
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Deletion of two sub-boards
« Reply #5 on: 15 May, 2018, 11:21:44 am »
Click click click.

A grateful audience salutes you ...


rogerzilla

  • When n+1 gets out of hand
Re: Deletion of two sub-boards
« Reply #6 on: 15 May, 2018, 05:58:13 pm »
Those boards should now be read-only to avoid anyone messing up Greenbank's good work.  They won't be after they've been moved, but I didn't want new, unlabelled, threads starting.
Hard work sometimes pays off in the end, but laziness ALWAYS pays off NOW.

Re: Deletion of two sub-boards
« Reply #7 on: 15 May, 2018, 06:39:39 pm »
For reference here's how I did it, it relies on keyboard shortcuts and trying to minimise mouse movement.

Get the prefix string [LEL17] or [HAMR] in the copy/paste buffer.

Open the specific forum index in a new browser window (I'm using Firefox).
1. Middle click on each thread to open the thread in a new browser tab (but focus stays on the current tab - the index).
2. Go back to the first new window (Ctrl+Tab then Ctrl+Tab will do it).
3. Click on 'modify', press Ctrl+Tab to move to the next tab, repeat for all tabs until you get back to the index. (You can't hold down Ctrl whilst clicking as it will open the modify page in a new tab.) The modify button is generally in the same place on each tab, so there's no need to move the mouse that often (threads with no replies and locked threads are the exception).
4. Once you're back to the index, go forward to the first new tab.
5. Position the mouse pointer at the start of the Subject text box (it'll be in the same place each time except for locked threads)
6. Hold down Ctrl for the whole of this step, left click at the start of the Subject text box, hit v (so you're doing Ctrl+V to paste in the prefix), then hit tab (i.e. Ctrl+Tab) to move to the next tab, click mouse at start of Subject text box, v, tab, repeat for all the tabs, now you can let go of Ctrl.
7. Back to the first one, move the mouse pointer down to the save button on the right hand side in the bottom half of the window.
8. Hold down Ctrl (again for the whole of this step), click save, press tab to move to next browser tab, click save, tab, click save, tab, etc... until you're back to the start. The save button doesn't move that much (only for bigger posts or locked topics). Now release Ctrl.
9. Now close all of the new browser tabs (leave the index tab there) once they have finished reloading, the title of each new browser tab should contain the prefix so it's easy to check if you've missed any.

Then repeat the above for all of the remaining index pages.

As a final check sort all of the threads by Subject and check the first/last pages to ensure that every thread contains the prefix.

Then you've got to create the index page. For this I used wget to grab the HTML for each of the index pages, e.g.

Code: [Select]
wget https://yacf.co.uk/forum/index.php?board=80.0
wget https://yacf.co.uk/forum/index.php?board=80.50
wget https://yacf.co.uk/forum/index.php?board=80.100
...
wget https://yacf.co.uk/forum/index.php?board=80.500

Then it's a case of a big command line to pull out all of the subject lines (which should be the only lines that contain the prefix) and strip out the HTML and make it into BB code for the index thread:-

Code: [Select]
grep "\[HAMR\]" index.php\?board\=80.0 index.php\?board\=80.50 index.php\?board\=80.100 index.php\?board\=80.150 index.php\?board\=80.200 index.php\?board\=80.250 index.php\?board\=80.300 index.php\?board\=80.350 index.php\?board\=80.400 index.php\?board\=80.450 index.php\?board\=80.500 | sed -e 's/.*href="//' -e 's/PHPSESSID.*amp;topic=/topic=/' -e 's/<\/a><\/span>.*//' -e 's/">\[/ /' -e 's/HAMR] //' -e 's/^/[url=/' -e 's/ /]/' -e 's/$/[\/url]/'

Worth sticking this through "wc -l" to check that it matches the number of threads in the forum.

Paste this output into a new thread (you may need to split it into multiple posts if it's bigger than 30,000 characters.
Mark the top n messages as "Sticky: " as required, then modify those individual threads to remove the sticky option in "Additional Options" so that they aren't sticky when they get moved into the parent forum.
"Yes please" said Squirrel "biscuits are our favourite things."

rogerzilla

  • When n+1 gets out of hand
Re: Deletion of two sub-boards
« Reply #8 on: 15 May, 2018, 07:06:03 pm »
All done now, thanks to Mr Greenbank.  Buy him a Frijj if you see him on the road!
Hard work sometimes pays off in the end, but laziness ALWAYS pays off NOW.

hellymedic

  • Just do it!
Re: Deletion of two sub-boards
« Reply #9 on: 15 May, 2018, 07:46:49 pm »
Thank you very much, Mr Greenbank.

I really appreciate your hard work!

Manotea

  • Where there is doubt...
Re: Deletion of two sub-boards
« Reply #10 on: 15 May, 2018, 10:14:23 pm »
Rather than work through the pages 'manually' (very fiddly)...

> Use your browser to grab the page source (and all subsequent pages that you're interested in and copy into excel
> Make judicious use of copy/replace, split data to columns and filter to isolate the elements you're interested in.
> Construct the links and paste to new YACF post.

Here's an index to the first page of the Audax board...

Index of all HAMR posts
Index of all LEL 2017 posts
Random audax questions
The company on DIYs and perms thread
May Day Chiltern Audaxes 7th May IMPORTANT UPDATE
New and Deleted AUK Permanent Events
Menu of epic rides.
Audax index, audax FAQs; check here before you ask.
ACME Grand 1000km 28 June 2018
Deletion of two sub-boards
Bryan Chapman Memorial 2018
The London Ditchling Devil 200km
Caffeine withdrawal
300km event for a mere £159
Madcap Projects List
West Highland 1000km.  Thu 31 May 2018
Dauntsey Dawdle 400 - 19th May
Mille Cymru 2018
Brevet Cymru 2018
Brevet Cymru / Porkers combo
AAA calculation
Tour of Berwyns/Panorama Prospect---May 19---Parking, Drinks and Bacon Butties
Audax Ecosse Jerseys - 2018 version
Mille Pennines 6th July 2018
12 May 2018:  Not Quite The Spurn Head (400 km) / The Old 240 (400 km)
[LEL17] Time to revert to PBP?
London-Wales-London
This is not a tour. Welsh rides in the spirit of Mike Hall - 2/3rd June 2018.
Round The Year Randonneurs Log
Audax Club Hackney 'last Thursday of the month' drinks
WessexSR2017
Back to the Smoke 2018
Bank Holiday May Day Chiltern Audaxes - Limited Entries left
Old Roads &amp; Drove Roads 200, NOW 18/08/18
Hop Garden rides
Beyond the Dales We Know 300 - Saturday 28/04/18
2 events same day...
2019 PBP Brochure
Cambrian Series Permanents
Lakes Audaxes
Minimalist 1000+ km kit
Manningtree 300 - 00:01h Sat 5th May &quot;Green &amp; Yellow Fields&quot;
Points on foreign rides
Have you been out today on a Perm or DIY?
Validation outside time limits wasRe: The Dean
MOVED: Environmental Audax effect &amp; Travel was Re: Map Lights
200 to 300
2018 North Yorkshire Brevets Unpopulaire
DIY route sharing thread
[HAMR] Another go .. TG??

rogerzilla

  • When n+1 gets out of hand
Re: Deletion of two sub-boards
« Reply #11 on: 15 May, 2018, 10:25:07 pm »
Show-off  :P
Hard work sometimes pays off in the end, but laziness ALWAYS pays off NOW.

Manotea

  • Where there is doubt...
Re: Deletion of two sub-boards
« Reply #12 on: 15 May, 2018, 11:37:35 pm »
Not often I get a chance :D

Re: Deletion of two sub-boards
« Reply #13 on: 16 May, 2018, 12:16:02 am »
Erm, that doesn't put a prefix in the subjects of all of the threads (~750 of them) though does it. That's the annoying manual bit.

The index creation was done using wget and sed, even easier than messing with excel.
"Yes please" said Squirrel "biscuits are our favourite things."

Manotea

  • Where there is doubt...
Re: Deletion of two sub-boards
« Reply #14 on: 16 May, 2018, 12:41:06 am »
Erm, that doesn't put a prefix in the subjects of all of the threads (~750 of them) though does it. That's the annoying manual bit.
doh! forgot that bit, though I'd argue once you have the index the prefix is a tadge redundent...

The index creation was done using wget and sed, even easier than messing with excel.
Well, it is if youre fluent in wget and sed. :)

Re: Deletion of two sub-boards
« Reply #15 on: 16 May, 2018, 07:53:56 am »
Erm, that doesn't put a prefix in the subjects of all of the threads (~750 of them) though does it. That's the annoying manual bit.
doh! forgot that bit, though I'd argue once you have the index the prefix is a tadge redundent...

The prefix was to make people searching for things easier. If they search the Audax forum for "Gearing" then they'll see threads with subjects:-

[PBP] Gearing
 ...
[LEL17] Gearing
 ...
[HAMR] Gearing
 ...

rather than just:-

Gearing
 ...
Gearing
 ...
Gearing
 ...

There's probably an SMF plugin to do batch modification like this. I had to manually edit a few that already had similar prefixes and a few that were up to the limit of Subject line length so it's not a completely automatable process.
"Yes please" said Squirrel "biscuits are our favourite things."

Manotea

  • Where there is doubt...
Re: Deletion of two sub-boards
« Reply #16 on: 16 May, 2018, 08:49:19 am »
There's probably an SMF plugin to do batch modification like this.

Quite possibly. Seem to be several Mods for applying prefixes to a Board or Individual Topics (who knew?). Whether they can be applied retrospectively would need looking into..

Re: Deletion of two sub-boards
« Reply #17 on: 16 May, 2018, 09:02:46 am »
There's probably an SMF plugin to do batch modification like this.

Quite possibly. Seem to be several Mods for applying prefixes to a Board or Individual Topics (who knew?). Whether they can be applied retrospectively would need looking into..

Give the manual job requires, on average, about an hour a year I'd say there was very little point spending any time attempting to automate it.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Deletion of two sub-boards
« Reply #18 on: 16 May, 2018, 11:20:28 am »
Grateful thanks to the Competent Ones.

Re: Deletion of two sub-boards
« Reply #19 on: 16 May, 2018, 05:16:22 pm »
Great to see a PBP 2019 board. 

Would it make sense if this thread was moved there?

https://yacf.co.uk/forum/index.php?topic=92923.msg1914035#msg1914035