Open greenwoodma opened 1 year ago
I've now updated this branch to also add flags for both promoted and related tweets. This uses the same approach as #17 for the promoted tweets (i.e. if you merge this PR that one is probably redundant) but extends it also to the reply tweets. A similar flag is then also used for the related tweets (these are the ones usually under a "Discover More" heading when viewed on the twitter web site).
I know multiple items in a single PR isn't the best strategy, but given the refactoring in the original it made more sense to add these extra flags here than in another PR that would have required extensive re-working if they were merged separately.
This PR relates to issue #10
Essentially with the current version of the plugin, if you view the page for a single tweet then nothing is collected (not the tweet being viewed or any of the replies). This PR fixes that by collecting data from the
TweetDetail
endpoint. The code for checking a normal tweet object has been pulled out into a function so we can use it under multiple conditions (relating to the different API endpoints and their structures) which avoids code duplication but does make more changes to the code than I originally intended.