Skip to content

Add additional tweet fields to TweetUtils; partially address #194.#254

Merged
ianmilligan1 merged 1 commit intoarchivesunleashed:masterfrom
ruebot:issue-194
Aug 11, 2018
Merged

Add additional tweet fields to TweetUtils; partially address #194.#254
ianmilligan1 merged 1 commit intoarchivesunleashed:masterfrom
ruebot:issue-194

Conversation

@ruebot
Copy link
Member

@ruebot ruebot commented Aug 10, 2018

GitHub issue(s): #194

What does this Pull Request do?

Adds the following addition fields to TweetUtils:

  • retweet_count
  • favorite_count
  • in_reply_to_status_id_str
  • in_reply_to_user_id_str
  • in_reply_to_screen_name
  • source
  • user.protected
  • user.profile_image_url
  • user.description
  • user.location
  • user.name
  • user.url
  • user.time_zone

How should this be tested?

Same as outlined in #252, but test additional fields.

Tests should take care of it all. But, definitely curious to see how it goes.

Additional Notes:

Still need to add some addition fields outlined in #194. Entity fields will be interesting since they are all an array.

Interested parties

@ianmilligan1 @greebie @lintool

@codecov
Copy link

codecov bot commented Aug 10, 2018

Codecov Report

Merging #254 into master will increase coverage by 0.37%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage   70.14%   70.52%   +0.37%     
==========================================
  Files          41       41              
  Lines        1025     1038      +13     
  Branches      191      191              
==========================================
+ Hits          719      732      +13     
  Misses        240      240              
  Partials       66       66
Impacted Files Coverage Δ
...n/scala/io/archivesunleashed/util/TweetUtils.scala 96.15% <100%> (+3.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62628b4...658f1fa. Read the comment docs.

assert(tweet.profileLocation() == null)
assert(tweet.profileName() == null)
assert(tweet.profileUrl() == null)
assert(tweet.profileTimezone() == null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use ".isEmpty" instead of == null, so scalastyle does not burp. Technically the return should be String instead of Null anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all of them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the assertions. Although this is strictly a style issue, so not mandatory. (e.g. assert(tweet.profileLocation().isEmpty))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's out of scope for this PR, and should be a new ticket. Create a new ticket.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. That weird - these should have been detected and resolved in #249. I will add the ticket and try to find out why scalastyle did not yell at me.

Copy link
Member

@ianmilligan1 ianmilligan1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with new categories and all looks good – just one minor typo fix and this is ready to merge.

/** Get the tweet text. */
def text(): String = try { (tweet \ "text").extract[String] } catch { case e: Exception => ""}
/** Get the full_text. */
/** Get the the tweet full_text. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double "the the" here

- Adds:
  - retweet_count
  - favorite_count
  - in_reply_to_status_id_str
  - in_reply_to_user_id_str
  - in_reply_to_screen_name
  - source
  - user.protected
  - user.profile_image_url
  - user.description
  - user.location
  - user.name
  - user.url
  - user.time_zone
- Updates some doc comments
- Updates tests
@ruebot
Copy link
Member Author

ruebot commented Aug 11, 2018

@ianmilligan1 done! I rebased locally, so it's all a single commit with the commit message I want. So, feel free to squash and merge when you're ready.

@ianmilligan1 ianmilligan1 merged commit e4cf9a7 into archivesunleashed:master Aug 11, 2018
@ruebot ruebot deleted the issue-194 branch August 11, 2018 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants