add amas to newsletter script
This commit is contained in:
parent
101574b605
commit
83458fdc9e
|
@ -152,6 +152,11 @@ async function main () {
|
||||||
variables: { sort: 'top', when: 'week', sub: 'meta' }
|
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({
|
const jobs = await client.query({
|
||||||
query: ITEMS,
|
query: ITEMS,
|
||||||
variables: { sub: 'jobs' }
|
variables: { sub: 'jobs' }
|
||||||
|
@ -179,6 +184,13 @@ ${top.data.items.items.map((item, i) =>
|
||||||
`${i + 1}. [${item.title}](https://stacker.news/items/${item.id})
|
`${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('')}
|
- ${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
|
##### Don't miss
|
||||||
${top.data.items.items.map((item, i) =>
|
${top.data.items.items.map((item, i) =>
|
||||||
`- [${item.title}](https://stacker.news/items/${item.id})\n`).join('')}
|
`- [${item.title}](https://stacker.news/items/${item.id})\n`).join('')}
|
||||||
|
|
Loading…
Reference in New Issue