Skip to content

Instantly share code, notes, and snippets.

@koike koike/patchgiIcon.cs
Last active Dec 14, 2015

Embed
What would you like to do?
static string _ = "";
static void Main()
{
while (true)
{
var wc = new WebClient();
var st = wc.OpenRead("https://twitter.com/patchgi");
var sr = new StreamReader(st, Encoding.UTF8);
var html = sr.ReadToEnd();
sr.Close();
st.Close();
var url = new Regex("<img class=\"ProfileAvatar-image \" src=\"(?<url>.*?)\" alt=\"パッチギ\">")
.Match(html)
.Groups["url"]
.Value;
if (!_.Equals(url))
{
wc.DownloadFile(url, url.Split('/').Last());
Console.WriteLine($"Download => {url}");
}
_ = url;
Thread.Sleep(90 * 1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.