7

One of the sites which people reference on Buddhism.SE is Piya Tan's "Dharmafarers".

The URLs of reference material on that site have changed, for example:

  • Old: http://dharmafarer.org/wordpress/wp-content/uploads/2009/12/5.16-Dependent-arising-piya.pdf
  • New: http://www.themindingcentre.org/dharmafarer/wp-content/uploads/2009/12/5.16-Dependent-arising-piya.pdf

The old URLs no longer work (and aren't redirected automatically).

They did implement this automatic redirection (301 Moved Permanently) ...

... but that doesn't appear to work for the Wordpress resource files (wp-content/uploads).


So, what tools can you recommend, to find a set hyperlinks -- e.g. all hyperlnks on Buddhism.SE which begin with http://dharmafarer.org/?

And is there any tool to edit these automatically i.e. in bulk?

  • 3
    You can use the url: search opton: buddhism.stackexchange.com/… which gives 471 posts atm. – rene Jul 27 '18 at 9:30
  • Thank you. That would be a lot to edit manually. – ChrisW Jul 27 '18 at 9:32
  • For an semi-automatic approach see tex.meta.stackexchange.com/a/7326/36296 – samcarter_is_at_topanswers.xyz Jul 27 '18 at 10:18
  • @samcarter So the "semi-automatic approach" was: 1) SEDE to get links; 2) browser to get content-to-be-edited; 3) emac+lisp to edit the content and to put edited text back into the O/S clipboard; 4) paste from clipboard into browser, and post. – ChrisW Jul 27 '18 at 10:26
  • I guess it may be possible to edit using the StackExchange API these days? – ChrisW Jul 27 '18 at 10:37
  • Yes, using the API for this would work. (A good rule of thumb is: if it's possible (manually) via the Stack Exchange app, it's possible via the API.) – Glorfindel Aug 12 '18 at 10:18
9

There exists, internally, a search-and-replace tool for rewriting links. It's very simple; if someone changes their entire URL scheme, it's not much help. But for stuff like this, where we can simply cut out one consistent part of each URL and drop in another... It works pretty well.

If you need this - and I'd consider anything over 100 links a need - post a feature-request on the appropriate site meta and we'll try & get it done.

For more complicated rewrites, you should also post a meta discussion: assuming folks agree on what needs to be done, it's trivially possible to script (as Glorfindel suggests) or even just crowd-source it.

| improve this answer | |
  • Was this tool used for rewriting HTTP links to HTTPS? In other words, is the Community user the one who makes these edits? – Sonic the Masked Werehog Aug 14 '18 at 22:34
  • There's a similar tool available for doing stuff like this cross-site, @Sonic; AFAIK that was used for the HTTP->HTTPS rewrite. – Shog9 Aug 14 '18 at 22:51
  • @Sonic yes, it is a script (written by Oded as far as I remember, as he fixed the bugs), which performs non-bumping edits and contributes the edits to the Community user. – Shadow Wizard Wearing Mask Aug 15 '18 at 10:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .