Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for retrieving an account's own statuses #1905

Open
ndarilek opened this issue Sep 16, 2023 · 2 comments
Open

Add example for retrieving an account's own statuses #1905

ndarilek opened this issue Sep 16, 2023 · 2 comments

Comments

@ndarilek
Copy link

Hey, sorry if this is included somewhere and I missed it. I'm trying to use this library to download my own statuses from Friendica and output a compatible outbox to import into Firefish. I'm not immediately clear how to get my own statuses. I don't think any of the timeline methods do that (E.g. home/local/public timelines, though I'm not entirely clear on what the public timeline is and how it differs from the local timeline.) There are methods to get account statuses but I don't see a way to get my own account ID. Am I missing something obvious?

Thanks.

@h3poteto
Copy link
Owner

Please use verifyAccountCredentials:

verifyAccountCredentials(): Promise<Response<Entity.Account>>

@Ryuno-Ki
Copy link
Contributor

I was solving this very problem today :)
Using GoToSocial this is the gist (for @[email protected], i.e. acct andre):

import generator from 'megalodon'

const BASE_URL = process.env.GOTOSOCIAL_URL
const access_token = process.env.GOTOSOCIAL_ACCESS_TOKEN
const client = new generator.Gotosocial(BASE_URL, access_token)
const account = await client.lookupAccount('andre');
const statuses = await client.getAccountStatuses(account.data.id, {
  exclude_reblogs: true,
  exclude_replies: true,
  limit: 10
});

You might need to tweak the options to fit your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants