|
@@ -53,14 +53,19 @@ export class TwitterApiProvider {
|
|
|
}
|
|
|
|
|
|
public async fetchUserTimeline(userId, maxId?) {
|
|
|
- const res = await this.client.get("statuses/user_timeline", {
|
|
|
- user_id: userId,
|
|
|
- max_id: maxId,
|
|
|
- include_entities: true,
|
|
|
- tweet_mode: "extended",
|
|
|
- count: 20
|
|
|
- });
|
|
|
- return res.data;
|
|
|
+ try {
|
|
|
+ const res = await this.client.get("statuses/user_timeline", {
|
|
|
+ user_id: userId,
|
|
|
+ max_id: maxId,
|
|
|
+ include_entities: true,
|
|
|
+ tweet_mode: "extended",
|
|
|
+ count: 20
|
|
|
+ });
|
|
|
+ return res.data;
|
|
|
+ } catch (e) {
|
|
|
+ console.error(e);
|
|
|
+ return [];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public async createFriendship(userId) {
|