aria / zeni / late for dinner
 
a bright-eyed possum and/or cyborg wolf and/or a glimmering nebula and/or a physical manifestation of yearning
 
mid-30s, genderweird, bi (as in bisexual), bi (as in biting)
 
icon by iRootie
 

 

 

 


 

bi flag gif from horseblob

 


lexi
@lexi

test

that worked suprisingly well!


lexi
@lexi

hey bird app users. you should see this

and indeed, they do!


lexi
@lexi

okay so if you want to use this, install twit, get some twitter tokens and just run this node.js script somewhere:

let T = new (require('twit'))({
      consumer_key: 'xxx',
      consumer_secret: 'xxxxxx',
      access_token: '000000-xxx',
      access_token_secret: 'xxx'
})

let latest = 999999999999

let main = async () => {
        console.log('Fetching page...')
        let res = await fetch('https://cohost.org/lexi')
        console.log('Fetched, parsing...')
        let text = await res.text()
        let start = '<script type="application/json" id="trpc-dehydrated-state">'
        let water = text.split('\n').find(e=>e.startsWith(start)).replace(start, '').slice(0, -("</script>".length))
        let hydrated = JSON.parse(water)
        let posts = hydrated.queries[5].state.data.posts
        console.log(`Parsed, found ${posts.length} chosts, comparing...`)
        let new_posts = posts.filter(e=>e.postId > latest).map(e=>e.singlePostPageUrl)
        console.log(`Found ${new_posts.length} new posts: [${new_posts.join(' | ')}]`)
        latest = posts[0].postId
        new_posts.map(e=>T.post('statuses/update', {status: `i just posted on cohost! ${e}`}))
}

setInterval(main, 60*1000)

lexi
@lexi

regarding this: DO NOT USE IT it has a bug where it finds "new" posts that arent new lol

EDIT: the issue is triaged, the order was in fact not chronological! i fixed the code


You must log in to comment.