Skip to content

Commit 89e767c

Browse files
committed
fixing mishap correcting inconsistency in api
1 parent 03cdd1d commit 89e767c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/org/loklak/harvester/TwitterScraper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ public TwitterTweet(JSONObject json) {
589589
}
590590
this.reply_count = MessageEntry.parseLong((Number) lazyGet(json, "reply_count"));
591591
this.retweet_count = MessageEntry.parseLong((Number) lazyGet(json, "retweet_count"));
592-
this.favourite_count = MessageEntry.parseLong((Number) lazyGet(json, "favourite_count"));
592+
this.favourite_count = MessageEntry.parseLong((Number) lazyGet(json, "favourites_count")); // inconsitency in naming, but twitter api defines so
593593
this.images = MessageEntry.parseArrayList(lazyGet(json, "images"));
594594
this.audios = MessageEntry.parseArrayList(lazyGet(json, "audio"));
595595
this.videos = MessageEntry.parseArrayList(lazyGet(json, "videos"));
@@ -856,7 +856,8 @@ public Post toJSON(final UserEntry user, final boolean calculatedData, final int
856856
if (this.provider_hash != null && this.provider_hash.length() > 0) this.put("provider_hash", this.provider_hash);
857857
this.put("reply_count", this.reply_count);
858858
this.put("retweet_count", this.retweet_count);
859-
this.put("favourite_count", this.favourite_count);
859+
// there is a slight inconsistency here in the plural naming but thats how it is noted in the twitter api
860+
this.put("favourites_count", this.favourite_count);
860861
this.put("place_name", this.place_name);
861862
this.put("place_id", this.place_id);
862863

0 commit comments

Comments
 (0)