Open
Conversation
According to the Twitter API docs at e.g. https://dev.twitter.com/rest/reference/get/users/lookup, a user can have a "status" field corresponding to their last posted status (assuming you can have permission to read it).
Hopefully this will increase coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is one attempt at trying to address #20. It probably isn't the best approach, but it was simple to implement.
According to the Twitter API docs at e.g. https://dev.twitter.com/rest/reference/get/users/lookup, a user can
have a "status" field corresponding to their last posted status (assuming you can have permission to read it).
This PR introduces a new type called LastStatus which is very similar to Status but missing a few fields:
lastStatusUser, which doesn't seem to be present, perhaps because it's already "inside" a user objectlastStatusRetweetedStatus, which seems to cause the tests to go into an infinite loop (and I haven't seen attested)I'm not exactly sure why
lastStatusRetweetedStatuscauses the tests to go into an infinite loop, but my hypothesis is that the values generated by QuickCheck are being generated in a way that makes them infinite. Specifically, I assume that each Maybe value gets generated randomly, perhaps with a 50% chance of coming up Just. A RetweetedStatus, has both a Status and a User, and the Status has a Maybe RetweetedStatus and a User, and a User has a Maybe LastStatus. So given a single RetweetedStatus, there are three Maybe values that need to be filled in; if each is filled in with 50% probability, then on average one-and-a-half values will be produced that need to be filled in. Removing the RetweetedStatus from the LastStatus drops the number of Maybes to one.Other fields in LastStatus might or might not be attested; anything that was Maybe, I copied in just in case it should show up somewhere.