Skip to content

Instantly share code, notes, and snippets.

//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
@copolii
copolii / so21641022
Last active August 29, 2015 13:56
StackOverflow Question 21641022: How do I parse class hierarchies with gson?Link: http://stackoverflow.com/questions/21641022
package com.copolii.example.so21641022.model.util;
import com.copolii.example.so21641022.model.a.TypeA_A;
import com.copolii.example.so21641022.model.a.TypeA_B;
import com.copolii.example.so21641022.model.b.TypeB_A;
import com.copolii.example.so21641022.model.b.TypeB_B;
import com.copolii.example.so21641022.model.base.AbstractSuperType;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import junit.framework.TestCase;