<commit_before>import express from "express";
import { uriPathInHTMLData } from "xss-filters";

const router = express.Router();

// TODO: Move this into a database and let the admin of ferreiro.me to
// create more urls as they need on the go
const SHORT_URL_TO_URL = {
  didlaunch:
    "https://developersindepth.com/?utm_source=ferreiro-blog&utm-campaign=did-launch&utm-medium=blog",
  dailyfocus:
    "https://www.slideshare.net/jgferreiro/redis-76234580?qid=4408d51d-497d-44b1-8a7a-b688dbd51f83&v=&b=",
  perfomance:
    "https://www.ferreiro.me/blog/speed-up-your-website-frontend-8-practical-tips",
  ian:
    "https://www.youtube.com/watch?v=R5Gzv7dwXKA&list=PLaN1b7vXPDt63YJVL2F7cmq7FZm1olKIn",
  rahma:
    "https://www.youtube.com/playlist?list=PLaN1b7vXPDt6f3jYSdFbVeeEixCxWSepj",
  redis:
    "https://www.slideshare.net/jgferreiro/redis-76234580?qid=4408d51d-497d-44b1-8a7a-b688dbd51f83&v=&b=",
  roundabout:
    "https://speakerdeck.com/ferreiro/web-performance-jorge-ferreiro-twitter-london-js-roundabout",
  "roundabout-feedback": "https://forms.gle/8uiSR2wz2VEs8qp47",
};

const MOVED_PERMANETLY_STATUS_CODE = 301;

// TODO: Move this into the API repository.
const getShortenedUrl = (permalink) =>
  new Promise((resolve, reject) => {
    const url = SHORT_URL_TO_URL[permalink];

    if (!url) {
      return reject("No URL found");
    }<commit_msg>Add remote<commit_after>import express from "express";
import { uriPathInHTMLData } from "xss-filters";

const router = express.Router();

// TODO: Move this into a database and let the admin of ferreiro.me to
// create more urls as they need on the go
const SHORT_URL_TO_URL = {
  remote:
    "https://www.youtube.com/watch?v=7XAvIKBBeAE&utm-source=ferreiro&utm-campaign=remote",
  didlaunch:
    "https://developersindepth.com/?utm_source=ferreiro-blog&utm-campaign=did-launch&utm-medium=blog",
  dailyfocus:
    "https://www.slideshare.net/jgferreiro/redis-76234580?qid=4408d51d-497d-44b1-8a7a-b688dbd51f83&v=&b=",
  perfomance:
    "https://www.ferreiro.me/blog/speed-up-your-website-frontend-8-practical-tips",
  ian:
    "https://www.youtube.com/watch?v=R5Gzv7dwXKA&list=PLaN1b7vXPDt63YJVL2F7cmq7FZm1olKIn",
  rahma:
    "https://www.youtube.com/playlist?list=PLaN1b7vXPDt6f3jYSdFbVeeEixCxWSepj",
  redis:
    "https://www.slideshare.net/jgferreiro/redis-76234580?qid=4408d51d-497d-44b1-8a7a-b688dbd51f83&v=&b=",
  roundabout:
    "https://speakerdeck.com/ferreiro/web-performance-jorge-ferreiro-twitter-london-js-roundabout",
  "roundabout-feedback": "https://forms.gle/8uiSR2wz2VEs8qp47",
};

const MOVED_PERMANETLY_STATUS_CODE = 301;

// TODO: Move this into the API repository.
const getShortenedUrl = (permalink) =>
  new Promise((resolve, reject) => {
    const url = SHORT_URL_TO_URL[permalink];

    if (!url) {
      return reject("No URL found");
    }
{'fraction_non_alphanumeric': 0.14376321353065538, 'fraction_numerical': 0.05813953488372093, 'mean_word_length': 4.68937875751503, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 17, 'lorem ipsum': 0, 'www.': 11, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6607904', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1187, 'n_words': 155}