Created
September 9, 2016 04:26
-
-
Save sanealytics/6152318c478b049b9faa04294be4820b to your computer and use it in GitHub Desktop.
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
library(mongolite) | |
# Connections to mongo | |
instagram <- mongo(collection = "InstagramV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE) | |
matches <- mongo(collection = "MatchesV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE) | |
corrections <- mongo(collection = "CorrectionsV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE) | |
# Get Instagram data we saved earlier | |
ids.df <- instagram$find(fields = '{"_id" : 1, "payload.created_time" : 1}') | |
ids.df.simple <- data.frame(id = ids.df$`_id`, | |
created_time = ids.df$payload$created_time, | |
stringsAsFactors = FALSE) | |
# Reorder by newest | |
ids.df.simple <- ids.df.simple[order(-as.numeric(ids.df.simple$created_time)), ] | |
# What has already been corrected by users | |
ids.done <- corrections$find(fields = '{"id" : 1}') # What has already been corrected | |
# What's left | |
ids.df.todo <- setdiff(ids.df.simple$id, ids.done$id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment