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

Support for: users/timelines/reverse_chronological #577

Open
lcpichette opened this issue Oct 22, 2022 · 0 comments
Open

Support for: users/timelines/reverse_chronological #577

lcpichette opened this issue Oct 22, 2022 · 0 comments

Comments

@lcpichette
Copy link

lcpichette commented Oct 22, 2022

As the title suggests, I'm looking to see if this package supports the home timeline (Reverse Chronological) endpoint. This is a pretty important endpoint as it replicates the homepage query on Twitter.


UPDATE: I'm now hoping an example for this will be added to the README to help other developers. Better yet, if docs could be added that list every support endpoint (as they don't match with twitter's api endpoints).

Note: My developer account has elevated access, not sure if this works without it.

UPDATE

WORKS:

api.get('/timeline', async (req, res) => {
    TwitterAPI.get('statuses/home_timeline', { count: 50 }, (err, data, response) => {
        res.send(data);
    });
});

Previous Attempts

DOTE NOT WORK (Data is now an empty array) :

api.get('/timeline', async (req, res) => {
    TwitterAPI.get('statuses/user_timeline', { screen_name: '<MyDeveloperAccountUsername>', count: 50 }, (err, data, res) => {
        console.log(err);
        console.log(data);
    });
});

I would think that since I see tweets on my homepage, the array shouldn't be empty.

DOES NOT WORK (prints undefined and nothing, in that order):

TwitterAPI.get('users/timelines/reverse_chronological', {}, (err, data, res) => {
        console.log(err);
        console.log(data);
    });

DOES NOT WORK (prints undefined and nothing, in that order; replace <developeraccountuserid> with my developer account's user id):

api.get('/timeline', async (req, res) => {
    TwitterAPI.get('users/<developeraccountuserid>/timelines/reverse_chronological', { count: 50 }, (err, data, res) => {
        console.log(err);
        console.log(data);
    });
});

Using a different query

WORKS (successfully sends accurate data back):

const q = req.params['q'] || 'banana';
    TwitterAPI.get('search/tweets', { q: q, count: 50 }, function(err, data, response) {
        res.send(data);
    });
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

1 participant