Skip to content

Commit

Permalink
Fixed the problem with long named movies
Browse files Browse the repository at this point in the history
  • Loading branch information
ar3h1d committed Oct 21, 2023
1 parent 2df2582 commit 4ffb971
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Letterboxd_30nama_Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
// @author ar3h1d
// @match https://letterboxd.com/film/*
// @grant none
// @license GPL3; https://github.com/ar3h1d/letterboxd_30nama_link/blob/main/LICENSE
// @copyright 2023, ar3h1d (https://github.com/ar3h1d)
// @icon https://raw.githubusercontent.com/ar3h1d/letterboxd_30nama_link/main/ltb30n.png
// @license GPL3;https://github.com/ar3h1d/letterboxd_30nama_link/blob/main/LICENSE
// @copyright 2023, ar3h1d (https://github.com/ar3h1d)
// ==/UserScript==

(function() {
'use strict';

// Extract movie title from the page
const movieTitle = document.querySelector('.headline-1').textContent.trim().toLowerCase().replace(/ /g, '-').replace(/'/g, '');
const movieTitle = document.querySelector('.headline-1').textContent.trim().toLowerCase();

// Check if the URL already contains the year
const yearFromUrl = window.location.href.match(/-(\d{4})$/);
Expand Down

0 comments on commit 4ffb971

Please sign in to comment.