mapping-elections / site

Website for Mapping Early American Elections
http://earlyamericanelections.org
0 stars 2 forks source link

NNV links broken #84

Closed jfbratt closed 5 years ago

jfbratt commented 6 years ago

It appears NNV changed the structure of their URL thus breaking all the links at the bottom of our map pages.

lmullen commented 6 years ago

Here is my guess as to what the problem is.

Here is the original URL structure:

https://elections.lib.tufts.edu/catalog/tufts:ny.uscongress1.1789

That same election is now located at

https://elections.lib.tufts.edu/catalog/5t34sk14h

My guess is that the original site was doing an XSLT transform of the XML files. Based on an errant comment in the HTML source for that page, I think they have switched over to using a Rails App.

image

A little Googling turns up tutorials for Rails on how to include a hash ID in the URL. Notice that the URLs created in that tutorial have the same kind of 9 random character IDs in the URL structure. I'm not saying that Tufts is using the same tutorial I linked to there. But if I am reading the Ruby correctly, it looks like those aren't hashes of an ID (which we could deal with) but random hashes, which is horrifying to contemplate.

I have written to Tufts Archives to see what is going on, and to Rosie to see if she knows whom to contact.

Assuming we have to fix this ourselves, what are our options?

(1) Is there a way that anyone can think of to figure out a mapping from the election IDs (ny.uscongress1.1789) to their new URLs (5t34sk14h)? I can't think of anything. If the old election ID were anywhere in the new pages we could scrape them and create a table, but I can't find it anywhere in the source of the page.

(2) If we can't figure out the correct links what can we do to remove the links (hopefully temporarily) without destroying the information that we have created by listing out the special elections and so forth?

There are two places we link back to NNV.

(a) We have the links back to the elections we used at the bottom of the page. These links are generated from the YAML metadata in each map page, and we could easily comment out the Jekyll code that creates those links.

(b) We also link to special elections from the body text. These are in Markdown and are highly specific to individual elections. My only thought (which is not appealing) is that we could include a snippet of JavaScript in the map pages that finds links to elections.lib.tufts and removes them.

What are your thoughts, @jfbratt @kalbers @gswain2?

lmullen commented 6 years ago

Temporarily fixed by removing or disabling all NNV links. https://github.com/mapping-elections/site/commit/f51853bd4fd85430bc5b7d1847460c83ff4ddde1

Will revert that commit (or at least delete that code) when NNV adds redirects, and will close issue then.