File tree Expand file tree Collapse file tree 3 files changed +350
-13
lines changed Expand file tree Collapse file tree 3 files changed +350
-13
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,7 @@ exports.handler = async function http(req) {
7
7
let body = parseBody ( req ) ;
8
8
try {
9
9
let url = body . url ;
10
-
11
- // 4. Check if the URL contains a video
12
- // Getting the Tweet Path
13
-
14
10
const tweetPath = parse ( url ) . pathname . split ( "/" ) [ 3 ] ;
15
-
16
- // 5. Prepare api request url
17
11
const requestUrl = `https://api.twitter.com/1.1/statuses/show.json?id=${ tweetPath } &tweet_mode=extended` ;
18
12
19
13
let data ;
@@ -37,19 +31,12 @@ exports.handler = async function http(req) {
37
31
} catch ( e ) {
38
32
console . error ( "error message" , e . message ) ;
39
33
40
- // returning the error
41
34
return {
42
35
headers : {
43
36
"content-type" : "application/json; charset=utf8" ,
44
37
} ,
45
38
body : JSON . stringify ( e . message ) ,
46
39
statusCode : 400 ,
47
40
} ;
48
- } finally {
49
- // Save data in db here
50
- // table = requests
51
- // key = date
52
- // prop = total number of requests today
53
- // value = number of requests today
54
41
}
55
42
} ;
You can’t perform that action at this time.
0 commit comments