Remove the appstore app. apps does most of what it used to do, now.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4778 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		@@ -1,4 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "type": "tildefriends-app",
 | 
			
		||||
  "emoji": "🛍"
 | 
			
		||||
}
 | 
			
		||||
@@ -1,55 +0,0 @@
 | 
			
		||||
async function get_apps() {
 | 
			
		||||
	let results = {};
 | 
			
		||||
	await ssb.sqlAsync(`
 | 
			
		||||
				SELECT messages.*
 | 
			
		||||
				FROM messages_fts('"application/tildefriends"')
 | 
			
		||||
				JOIN messages ON messages.rowid = messages_fts.rowid
 | 
			
		||||
				ORDER BY timestamp
 | 
			
		||||
		`,
 | 
			
		||||
		[],
 | 
			
		||||
		function(row) {
 | 
			
		||||
			let content = JSON.parse(row.content);
 | 
			
		||||
			for (let mention of content.mentions) {
 | 
			
		||||
				if (mention?.type === 'application/tildefriends') {
 | 
			
		||||
					results[JSON.stringify([row.author, mention.name])] = {
 | 
			
		||||
						message: row,
 | 
			
		||||
						blob: mention.link,
 | 
			
		||||
						name: mention.name,
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
	return Object.values(results).sort((x, y) => y.message.timestamp - x.message.timestamp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function render_app(app) {
 | 
			
		||||
	return `
 | 
			
		||||
		<div style="border: 2px solid white; display: inline-block; margin: 8px; padding: 8px">
 | 
			
		||||
			<a href="/~cory/ssb/#${app.message.author}">@</a>
 | 
			
		||||
			<a href="/~cory/ssb/#${app.message.id}">%</a>
 | 
			
		||||
			<a href="/${app.blob}/">${app.name}</a>
 | 
			
		||||
		</div>
 | 
			
		||||
	`;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function main() {
 | 
			
		||||
	let apps = await get_apps();
 | 
			
		||||
	app.setDocument(`
 | 
			
		||||
		<html>
 | 
			
		||||
			<head>
 | 
			
		||||
				<base target="_top">
 | 
			
		||||
				<style>
 | 
			
		||||
					a:link { color: #bbf; }
 | 
			
		||||
					a:visited { color: #ddd; }
 | 
			
		||||
					a:hover { color: #ddf; }
 | 
			
		||||
				</style>
 | 
			
		||||
			</head>
 | 
			
		||||
			<body style="color: #fff">
 | 
			
		||||
				<h1>${apps.length} apps</h1>
 | 
			
		||||
				${apps.map(render_app).join('\n')}
 | 
			
		||||
			</body>
 | 
			
		||||
		</html>
 | 
			
		||||
	`);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
main();
 | 
			
		||||
		Reference in New Issue
	
	Block a user