1

I used the following curl command to receive tweets as well as info of tweets from a specific account:

curl --request POST \
  --url https://api.twitter.com/1.1/tweets/search/fullarchive/production.json \
  --header 'authorization: Bearer AAAAAAAAAAAAAAAAAAAAAHzE8wAAAAAATpIskAbraT5V0OSNaWKwrt%2Fz99I%3DcS8seKux26Ic3wcNjpAwPVFJ5I055ZuLyYAQNTMsIx55o1nIK5' \
  --header 'content-type: application/json' \
  --data '{
                "query":"from:TwitterDev lang:en",
                "maxResults": "100",
                "fromDate":"201802010000", 
                "toDate":"201802282359"
           }' 

the response I receive is all on one line, my question is how can I separate the line of response based on each tweet received?

Vincent D'amour
  • 3,746
  • 1
  • 27
  • 39
  • 1
    what does the response look like. It seems to be a json (escaped), you might want to further process it (parse it). I am not sure using bash is best for [this job](https://stackoverflow.com/questions/1955505/parsing-json-with-unix-tools), but you can try it. – xhg Mar 19 '19 at 20:25
  • response looks like this {"results":[{"created_at":"Wed Dec 06 01:09:25 +0000 2017","id":938213757678968832,"id_str":"938213757678968832","text":"RT luckymarmot: New APIs ready to import in Paw: GitHub Stripe, "source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null –  Mar 19 '19 at 20:35
  • 1
    good. You just need to parse it. see the link in my previous comment for possible solutions. I did not try it myself. good luck. – xhg Mar 19 '19 at 20:36
  • thank you so much. i really appreciate it. –  Mar 19 '19 at 21:01

0 Answers0