Skip to content

Commit

Permalink
#56
Browse files Browse the repository at this point in the history
  • Loading branch information
extratone committed May 11, 2022
1 parent bb3e9a2 commit 6c7bd28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dev/ImportTweetV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ let selected = editor.getSelectedRange()[1] > 0 ? editor.getSelectedText() : edi

var id = selected.substring(selected.lastIndexOf('/') + 1);

let baseURL = `https://api.twitter.com/2/tweets/${id}`;
let baseURL = `https://api.twitter.com/2/tweets`;

var params = "attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,public_metrics,referenced_tweets,reply_settings,source,text,withheld";
var params = {"ids": id, "expansions": "author_id,referenced_tweets.id,in_reply_to_user_id,geo.place_id,attachments.media_keys,attachments.poll_ids,entities.mentions.username,referenced_tweets.id.author_id", "tweet.fields": "id,created_at,text,author_id,in_reply_to_user_id,referenced_tweets,attachments,withheld,geo,entities,public_metrics,lang,context_annotations,conversation_id,reply_settings"};

let head = `Authorization: Bearer ${token}`;

Expand All @@ -40,7 +40,7 @@ var response = http.request({
"headers": {
"Authorization" : "Bearer " + token,
},
"parameters": "tweet.fields=" + params,
"parameters": params,
});

if (response.statusCode == 200 || response.statusCode == 201) {
Expand Down

0 comments on commit 6c7bd28

Please sign in to comment.