Created
February 14, 2015 23:53
-
-
Save DannyDelott/9c9fa16cf854cbea4024 to your computer and use it in GitHub Desktop.
Begin scraping Vine Videos
This file contains 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
// instantiates buffers | |
buffer1 = new TweetBuffer(1, SAVE_DIRECTORY); | |
buffer2 = new TweetBuffer(2, SAVE_DIRECTORY); | |
currentBufferId = 1; | |
duplicateUrls = new HashSet < String > (); | |
// instantiates listener to fill and process the buffers | |
StatusListener listener = new StatusListener() { | |
@Override | |
public void onStatus(Status status) { | |
if ((currentBufferId == 1) && !buffer1.isProcessing()) { | |
buffer1.addStatus(status); | |
return; | |
} | |
if ((currentBufferId == 2) && !buffer2.isProcessing()) { | |
buffer2.addStatus(status); | |
return; | |
} | |
} | |
@Override | |
public void onTrackLimitationNotice(int numLimitedStatuses) { | |
processCurrentBuffer(); // see Step 4 | |
} | |
}); | |
// starts scraping Vine videos | |
twitter.addListener(listener); | |
twitter.filter(fq); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment