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 96bf485 commit 00443f0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dev/ImportTweetV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ const token = credential.getValue("token");

let selected = editor.getSelectedRange()[1] > 0 ? editor.getSelectedText() : editor.getText();


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

let baseURL = `https://api.twitter.com/2/tweets`;

var params = {"ids": id, "expansions": "geo.place_id, attachments.media_keys, entities.mentions.username", "tweet.fields": "created_at, text, referenced_tweets, attachments, geo, entities, context_annotations, conversation_id, reply_settings", "user.fields": "username, verified, profile_image_url, location, url, description", "media.fields": "url", "place.fields": "geo"};

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

var http = HTTP.create();

var response = http.request({
Expand All @@ -31,8 +28,7 @@ var response = http.request({
});

if (response.statusCode == 200 || response.statusCode == 201) {
let data = response.responseData.data;
/* mdlink.push(`${text}\n${mdlink}`); */
let data = response.responseText;
let d = Draft.create();
d.content = data;
d.update();
Expand Down

0 comments on commit 00443f0

Please sign in to comment.