Using ChatGPT to make a JavaScript bookmarklet

I get newsletters from the Chronicle of Higher Education. They frequently have links to interesting articles on the Chronicle’s web site, but they are also a little bit annoying. The articles are paywalled, but I don’t have a personal account. Instead, I read using my institution’s account. Because of that, I often have trouble logging in at the home page and then finding the article again. For fun, I wanted to see if this was a problem ChatGPT could help me fix. (Spoiler alert, it can. Solution below.)

If you happen to be a Wichita State person reading this (hello student or colleague!), here’s the bookmarklet: [read via WSU]

You can just drag it to your browser’s bookmarks bar and it should work. If not, you can copy the code from this Gist and paste it into your browser’s bookmarks menu like in the video above.

EDIT: I changed the name of the bookmarklet in the link above because this works with lots of other services as well, including fan-favorite JSTOR.