<commit_before>const router = require('express').Router();
const rp = require('request-promise');
const covert = require('../../covert.js');

router.get('/', async (req, res) => {
	const domain = covert.app_url;
	
	const popular_packs = await rp({uri: `${domain}/api/sticker-packs?sort=popular`, json: true});
	const static_routes = [
		'/sticker-packs',
		'/docs',
		'/terms.html'
	];

	const pack_xml = popular_packs.packs.map(pack => `<url><loc>${domain}/pack/${pack.key}</loc></url>`).join('');
	const route_xml = static_routes.map(route => `<url><loc>${domain}${route}</loc></url>`).join('');

	const xml = `
		<?xml version="1.0" encoding="UTF-8"?>
		<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
		${route_xml + pack_xml}
		</urlset>
	`.replace(/(\t|\n)+/g, '');

	res.set('Content-Type', 'text/xml');
	res.send(xml);
});

module.exports = router; <commit_msg>Include ALL sticker packs + homepage in sitemap for better indexing<commit_after>const router = require('express').Router();
const rp = require('request-promise');
const covert = require('../../covert.js');

router.get('/', async (req, res) => {
	const domain = covert.app_url;
	
	const popular_packs = await rp({uri: `${domain}/api/sticker-packs?sort=all`, json: true});
	const static_routes = [
		'', // <- Homepage
		'/sticker-packs',
		'/docs',
		'/terms.html'
	];

	const pack_xml = popular_packs.packs.map(pack => `<url><loc>${domain}/pack/${pack.key}</loc></url>`).join('');
	const route_xml = static_routes.map(route => `<url><loc>${domain}${route}</loc></url>`).join('');

	const xml = `
		<?xml version="1.0" encoding="UTF-8"?>
		<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
		${route_xml + pack_xml}
		</urlset>
	`.replace(/(\t|\n)+/g, '');

	res.set('Content-Type', 'text/xml');
	res.send(xml);
});

module.exports = router; 
{'fraction_non_alphanumeric': 0.2399669011170873, 'fraction_numerical': 0.014894497310715763, 'mean_word_length': 4.676056338028169, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 2, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, 'xml': 28}, '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': '7110229', 'n_tokens_mistral': 975, 'n_tokens_neox': 902, 'n_words': 124}