This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.map.call(document.querySelectorAll('button.INTERNAL_AVAILABLE'), e => { | |
const tld = e.querySelector('.tld-part').innerText | |
return { | |
tld, | |
tldLength: tld.split('').length, | |
price: Number(e.querySelector('.price').childNodes[1].textContent) | |
}} | |
) | |
.reduce((acc, curr) => { | |
(acc[curr.tldLength] = acc[curr.tldLength] || []).push(curr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://letterboxd.com/kun/list/atmospheric-slow-boiling-terrors-that-chill | |
var movies = document.querySelectorAll('.film-list li'); | |
var a = Array.prototype.map.call(movies, movie => { | |
const {filmId, filmLink, filmName, filmReleaseYear} = movie.querySelector('div').dataset | |
return {filmId, filmLink, filmName, filmReleaseYear} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get movies title, year & id from imdb list page | |
// example page: https://www.imdb.com/list/ls062489465/ | |
var movies = document.querySelectorAll('.lister-item') | |
Array.prototype.map.call(movies, movie => { | |
const title = movie.querySelector('h3 a').innerText | |
const year = movie.querySelector('.lister-item-year').innerText | |
const image = movie.querySelector('.lister-item-image') | |
const imdbId = image.dataset.tconst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Desde la consola de Chrome ejecutar el siguiente script que te devolverá una lista con los títulos de las películas disponibles en la lista. "Botón derecho > guardar cómo" en la consola para guardar la lista a formato .txt | |
// Comprobado por última vez que funciona el 26 de Julio de 2018. | |
// URL de ejemplo: https://www.fotogramas.es/noticias-cine/g19473125/mejores-peliculas-clasicas-historia/ | |
var titles = document.getElementsByClassName('listicle-slide-hed-text'); | |
Array.prototype.map.call(titles, title => title.innerText); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'json' | |
require 'cgi' | |
addresses = [ | |
'Verdi,32,8012,Barcelona,España', | |
'Pg. Sant Antoni,43,8014,Barcelona,España', | |
'C. de Floridablanca,135,8011,Barcelona,España' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="archive"> | |
<h2>Posts escritos este año</h2> | |
{%for post in site.posts %} | |
{% unless post.next %} | |
<ul class="this"> | |
{% else %} | |
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %} | |
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %} | |
{% if year != nyear %} | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directories = %w(models lib) | |
directories.each do |directory| | |
Dir["#{File.dirname(__FILE__)}/#{directory}/*.rb"].each do |file| | |
require file | |
end | |
end |