2
votes

I'm working with Twitter's API to retrieve a list of tweets from a Twitter account.

I'm using this: https://dev.twitter.com/rest/reference/get/statuses/user_timeline

I get the JSON response (http://pastebin.com/raw/zqyUuXcG) but in the text field (at the end of it) I also have the url to the tweet itself. I'd like to avoid that because I want to keep the text clean and put the url in an hyperlink (like on date or on the container div).

I couldn't find a way to avoid url to be included in the text field. Is there a way to do it?

Thanks

1

1 Answers

0
votes

Depends on the method you want to use after you obtain a JSON response, but doesn't look like you have direct control over URL placement straight from the API.

You could use grep to either extract the URL or filter it out from the text field.

For example, in R, this chunk of code would remove everything after and including "https":

gsub( "https.*$", "", textfield)