Skip to content

Instantly share code, notes, and snippets.

@jameshartig
jameshartig / ioCrawler.go
Last active September 19, 2018 00:23
Google I/O 2014 redeem easter egg crawler
//before running make sure you setup a GOPATH env variable and ran: "go get code.google.com/p/go.net/html"
//to run: go run ioCrawler.go -url="http://developers.google.com/"
//also try http://developer.android.com/index.html
//output goo.gl links to try and redeem will be sent to foundLinks.txt
//by the way there's an artificial "rate limit" in func crawler, you can lower that or raise it as you wish
//You can also comment out the onlyGoogleRegex code if you don't want to limit to google.com/youtube
//if you're getting I/O timeout errors, then you might need to increase the timeouts on line 231
@cavega
cavega / RxCombineApiCalls
Created March 23, 2015 13:50
Use RXJava for Merging Response of 2 API calls
Observable.combineLatest(
ApiProvider.requestSource1(param1),
ApiProvider.requestSource2(param2),
this::combinedResponses)
.map(responseObject -> saveResponse(responseObject, context))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(responseObject -> onResponseReceived(responseObject, listener),
null != errorCallback ? errorCallback : this::onFetchObjectFailed);