diff --git a/scripts/newsletter.js b/scripts/newsletter.js index f6bbb8d7..60eb781c 100644 --- a/scripts/newsletter.js +++ b/scripts/newsletter.js @@ -152,6 +152,11 @@ async function main () { variables: { sort: 'top', when: 'week', sub: 'meta' } }) + const ama = await client.query({ + query: ITEMS, + variables: { sort: 'top', when: 'week', sub: 'ama' } + }) + const jobs = await client.query({ query: ITEMS, variables: { sub: 'jobs' } @@ -179,6 +184,13 @@ ${top.data.items.items.map((item, i) => `${i + 1}. [${item.title}](https://stacker.news/items/${item.id}) - ${abbrNum(item.sats)} sats${item.boost ? ` \\ ${abbrNum(item.boost)} boost` : ''} \\ ${item.ncomments} comments \\ [@${item.user.name}](https://stacker.news/${item.user.name})\n`).join('')} +##### Top AMAs +${ama.data.items.items.slice(0, 3).map((item, i) => + `${i + 1}. [${item.title}](https://stacker.news/items/${item.id}) + - ${abbrNum(item.sats)} sats${item.boost ? ` \\ ${abbrNum(item.boost)} boost` : ''} \\ ${item.ncomments} comments \\ [@${item.user.name}](https://stacker.news/${item.user.name})\n`).join('')} + +[**all AMAs**](https://stacker.news/~meta/top/posts/forever) + ##### Don't miss ${top.data.items.items.map((item, i) => `- [${item.title}](https://stacker.news/items/${item.id})\n`).join('')}