Skip to content

Commit

Permalink
Merge pull request #32 from sammygriffiths/release/v1.0.0
Browse files Browse the repository at this point in the history
Release/v1.0.0
  • Loading branch information
sammygriffiths authored Oct 5, 2024
2 parents c36dc24 + 0ca0016 commit 03e56ea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frinkiac-gif-generator",
"version": "0.8.2",
"version": "1.0.0",
"description": "Generate Simpsons gifs based on a search term from frinkiac.com",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const stringSimilarity = require('string-similarity');

const helpers = {
formatSubtitleText: (text) => {
let wrappedText = wrap(text, { width: 28, indent: '' });
let wrappedText = wrap(text, { width: 26, indent: '' });
let subtitleText = Buffer.from(wrappedText).toString('base64');
let replacedSlashText = subtitleText.replace(/\//g, '_');
let replacedPlusText = replacedSlashText.replace(/\+/g, '-');
Expand Down
6 changes: 3 additions & 3 deletions test/src/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('API', () => {
Content: text
};

let expectedText = 'VGhpcyBpcyBhIGxvbmcgcGllY2Ugb2YgdGV4dCAKdGhhdCBuZWVkcyB0byBiZSBzcGxpdCBvbiB0byAKbXVsdGlwbGUgbGluZXM_Pz8_Pz4-Pj4-';
let expectedText = 'VGhpcyBpcyBhIGxvbmcgcGllY2Ugb2YgCnRleHQgdGhhdCBuZWVkcyB0byBiZSAKc3BsaXQgb24gdG8gbXVsdGlwbGUgCmxpbmVzPz8_Pz8-Pj4-Pg==';
let expectedUrl = 'https://frinkiac.com/gif/S07E21/1/2.gif?b64lines=' + expectedText;

const axios = {
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('API', () => {
});
describe('generateGif', () => {
it('gets the appropriate gif from frinkiac', async () => {
let expectedUrl = 'https://frinkiac.com/video/S10E07/MI9Rd6R0gNkiZnr2cFb_wA8vC3k=.gif';
let expectedUrl = 'https://frinkiac.com/video/S10E07/2BgqWeuWjvumnQewtcAinhUVhXU=.gif';
let term = 'super nintendo chalmers';

let result = await api(require('axios'), config).generateGif(term);
Expand All @@ -172,7 +172,7 @@ describe('API', () => {
}).timeout(10000);

it('gets the appropriate gif from frinkiac with multiple captions', async () => {
let expectedUrl = 'https://frinkiac.com/video/S06E08/FudWxOoaKmj_5Sk8zzxbYtTqot4=.gif';
let expectedUrl = 'https://frinkiac.com/video/S06E08/CXUO_0Mn1AupcjkdvINxh3hzaSQ=.gif';
let term = "We'd ask you to come, but... You know...";

let result = await api(require('axios'), config).generateGif(term);
Expand Down
2 changes: 1 addition & 1 deletion test/src/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('helpers', () => {

it('adds line breaks in the text where appropriate', () => {
let text = 'This is a long piece of text that needs to be split on to multiple lines';
let expectedText = 'VGhpcyBpcyBhIGxvbmcgcGllY2Ugb2YgdGV4dCAKdGhhdCBuZWVkcyB0byBiZSBzcGxpdCBvbiB0byAKbXVsdGlwbGUgbGluZXM=';
let expectedText = 'VGhpcyBpcyBhIGxvbmcgcGllY2Ugb2YgCnRleHQgdGhhdCBuZWVkcyB0byBiZSAKc3BsaXQgb24gdG8gbXVsdGlwbGUgbGluZXM=';

let returnedText = helpers.formatSubtitleText(text);

Expand Down

0 comments on commit 03e56ea

Please sign in to comment.