From bdf02463e255978cf3a1d98f2edda01e9f3d6e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Epu=C3=B1an?= Date: Wed, 27 Dec 2023 09:13:53 -0300 Subject: [PATCH 1/5] fix: new domain for YTS API `.ag => .mx` --- scripts/torrent.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/torrent.js b/scripts/torrent.js index a16cca71..dfb39eff 100644 --- a/scripts/torrent.js +++ b/scripts/torrent.js @@ -1,10 +1,10 @@ // Description: -// Search torrents from yts.ag +// Search torrents from yts.mx // // Dependencies: // // Commands: -// hubot torrent - Search torrents for query from yts.ag +// hubot torrent - Search torrents for query from yts.mx // // Author: // @jorgeepunan @@ -14,7 +14,7 @@ module.exports = function (robot) { msg.send('Esperando respuesta de YTS YIFY... :loading:') var busqueda = msg.match[1] - var api = 'https://yts.am/api/v2/list_movies.json?limit=5&query_term=' + var api = 'https://yts.mx/api/v2/list_movies.json?limit=5&query_term=' var url = api + busqueda.split(' ').join('+') robot.http(url).get()(function (error, response, body) { From 11bd096fa66cdce831a2ece4e47fbb6d867cc313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Epu=C3=B1an?= Date: Wed, 27 Dec 2023 09:20:11 -0300 Subject: [PATCH 2/5] fix: update torrent.test.js --- test/torrent.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/torrent.test.js b/test/torrent.test.js index acee8ed2..8815204c 100644 --- a/test/torrent.test.js +++ b/test/torrent.test.js @@ -13,15 +13,15 @@ test.beforeEach(t => { test.afterEach(t => t.context.room.destroy()) test('Torrent de Titanic', async t => { - nock('https://yts.am') + nock('https://yts.mx') .get('/api/v2/list_movies.json') .query({ limit: 5, query_term: 'titanic' }) .reply(200, { data: { movie_count: 2, movies: [ - { url: 'https://yts.am/movie/titanic-1997', title: 'Titanic', year: 1997, rating: 7.8 }, - { url: 'https://yts.am/movie/titanic-1953', title: 'Titanic', year: 1953, rating: 7.2 } + { url: 'https://yts.mx/movie/titanic-1997', title: 'Titanic', year: 1997, rating: 7.8 }, + { url: 'https://yts.mx/movie/titanic-1953', title: 'Titanic', year: 1953, rating: 7.2 } ] } }) @@ -38,8 +38,8 @@ test('Torrent de Titanic', async t => { // test response messages of hubot t.deepEqual(hubotMessage1, ['hubot', 'Esperando respuesta de YTS YIFY... :loading:']) const text = `Encontradas 2 coincidencias: - - -Todos los resultados en **` + + +Todos los resultados en **` t.deepEqual(hubotMessage2, ['hubot', text]) }) From 7590311949d6d384f1fe576e3c8ec84a3e4ae7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Epu=C3=B1an?= Date: Wed, 27 Dec 2023 11:16:44 -0300 Subject: [PATCH 3/5] fix: test output updated --- test/torrent.test.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/torrent.test.js b/test/torrent.test.js index 8815204c..5fe6dd0b 100644 --- a/test/torrent.test.js +++ b/test/torrent.test.js @@ -37,9 +37,12 @@ test('Torrent de Titanic', async t => { // test response messages of hubot t.deepEqual(hubotMessage1, ['hubot', 'Esperando respuesta de YTS YIFY... :loading:']) - const text = `Encontradas 2 coincidencias: - - -Todos los resultados en **` + const text = `Encontradas 20 coincidencias: + + + + + +Todos los resultados en **` t.deepEqual(hubotMessage2, ['hubot', text]) }) From 6a3bca12087aab9011dca11ba0a3c67ff16b58fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Epu=C3=B1an?= Date: Wed, 27 Dec 2023 11:21:08 -0300 Subject: [PATCH 4/5] fix: update test output --- test/torrent.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/torrent.test.js b/test/torrent.test.js index 5fe6dd0b..1496c087 100644 --- a/test/torrent.test.js +++ b/test/torrent.test.js @@ -18,10 +18,13 @@ test('Torrent de Titanic', async t => { .query({ limit: 5, query_term: 'titanic' }) .reply(200, { data: { - movie_count: 2, + movie_count: 20, movies: [ - { url: 'https://yts.mx/movie/titanic-1997', title: 'Titanic', year: 1997, rating: 7.8 }, - { url: 'https://yts.mx/movie/titanic-1953', title: 'Titanic', year: 1953, rating: 7.2 } + { url: 'https://yts.mx/movies/titanic-25-years-later-with-james-cameron-2023', title: 'Titanic: 25 Years Later with James Cameron', year: 2023, rating: 6.5 }, + { url: 'https://yts.mx/movies/titanic-waltz-1965', title: 'Titanic Waltz', year: 1965, rating: 8.6 }, + { url: 'https://yts.mx/movies/the-blind-man-who-did-not-want-to-see-titanic-2021', title: 'The Blind Man Who Did Not Want to See Titanic', year: 2021, rating: 7.5 }, + { url: 'https://yts.mx/movies/titanic-666-2022', title: 'Titanic 666', year: 2022, rating: 3.2 }, + { url: 'https://yts.mx/movies/the-chambermaid-on-the-titanic-1997', title: 'The Chambermaid on the Titanic', year: 1997, rating: 6.6 } ] } }) From a5c5eadc298e4d176e5297e080c9121234ade38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Epu=C3=B1an?= Date: Tue, 18 Jun 2024 16:46:44 -0300 Subject: [PATCH 5/5] feat: domestic improvements Better output. Test: `huemul bin chile` https://i.imgur.com/dytcq2R.png --- scripts/bin-checker.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/bin-checker.js b/scripts/bin-checker.js index de85ee8b..eb608589 100644 --- a/scripts/bin-checker.js +++ b/scripts/bin-checker.js @@ -8,6 +8,7 @@ // None // // Commands: +// hubot bin help // hubot bin // // Author: @@ -65,16 +66,16 @@ module.exports = function (robot) { const cards = Array.from(cardsContainer).map(card => $(card).text().replace(/\n/g, ' ').trim()) if (cards.length) { - msg.send(`Encontramos ${cards.length}💳 para ${bankName}\n${cards}`) + msg.send(`Encontramos *${cards.length}* 💳 para *${bankName}*:\n${cards.join(',').replace(/,/g, '\n').split()}`) } else { - msg.send(`No encontramos tarjetas para ${bankName}`) + msg.send(`No encontramos tarjetas para *${bankName}*`) } } else { msg.send(':facepalm: Error: ', error) } }) } else { - msg.send('🏦 Banco no encontrado. Deja de inventar o haz un PR.') + msg.send('Banco 🏦 no encontrado. Deja de inventar o haz un PR.') } }) }