B
BataBo Jokviu
Guest
Currently I'm making minecraft name checker and mojang api server returns with error 429 after 700 iterations.Here is my code:
class Program
{
private static String _outputFileAvailable = "available.txt";
private static String _outputFileUnavailable = "unavailable.txt";
static void Main(string[] args)
{
var AvailableNum = 0;
var UnavailableNum = 0;
Console.Title = "Cookie name checker | by BataBo | Checked: " + (AvailableNum + UnavailableNum) + " | Good:" + AvailableNum;
using (StreamWriter availableWriter = File.AppendText(_outputFileUnavailable))
{
using (StreamWriter unavailableWriter = File.AppendText(_outputFileAvailable))
{
foreach (string line in File.ReadLines("Usernames.txt"))
{
args = new[]
{
"https://api.mojang.com/users/profiles/minecraft/" + line
};
var client = new WebClient();
client.Headers[HttpRequestHeader.UserAgent] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11";
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
client.Headers[HttpRequestHeader.Accept] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
client.Headers[HttpRequestHeader.AcceptEncoding] = "gzip,deflate,sdch";
client.Headers[HttpRequestHeader.AcceptLanguage] = "en-GB,en-US;q=0.8,en;q=0.6";
client.Headers[HttpRequestHeader.AcceptCharset] = "ISO-8859-1,utf-8;q=0.7,*;q=0.3";
var content = ScrubContent(client.DownloadString(args[0]));
if (content == "")
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Name {0} is available", line);
unavailableWriter.WriteLine(line);
AvailableNum++;
Console.Title = "Cookie name checker | by BataBo | Checked: " + (AvailableNum + UnavailableNum) + " | Good:" + AvailableNum;
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Name {0} is not available", line);
availableWriter.WriteLine(line);
UnavailableNum++;
Console.Title = "Cookie name checker | by BataBo | Checked: " + (AvailableNum + UnavailableNum) + " | Good:" + AvailableNum;
}
}
}
}
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("====================Results====================");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("Checked: {0} names", AvailableNum + UnavailableNum);
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Available names: {0} names", AvailableNum);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Unavailable names: {0} names", UnavailableNum);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("====================Results====================");
Console.ReadLine();
}
static string ScrubContent(string content)
{
return new string(content.Where(c => c != '\n').ToArray());
}
}
Can anyone help me?
Continue reading...
class Program
{
private static String _outputFileAvailable = "available.txt";
private static String _outputFileUnavailable = "unavailable.txt";
static void Main(string[] args)
{
var AvailableNum = 0;
var UnavailableNum = 0;
Console.Title = "Cookie name checker | by BataBo | Checked: " + (AvailableNum + UnavailableNum) + " | Good:" + AvailableNum;
using (StreamWriter availableWriter = File.AppendText(_outputFileUnavailable))
{
using (StreamWriter unavailableWriter = File.AppendText(_outputFileAvailable))
{
foreach (string line in File.ReadLines("Usernames.txt"))
{
args = new[]
{
"https://api.mojang.com/users/profiles/minecraft/" + line
};
var client = new WebClient();
client.Headers[HttpRequestHeader.UserAgent] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11";
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
client.Headers[HttpRequestHeader.Accept] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
client.Headers[HttpRequestHeader.AcceptEncoding] = "gzip,deflate,sdch";
client.Headers[HttpRequestHeader.AcceptLanguage] = "en-GB,en-US;q=0.8,en;q=0.6";
client.Headers[HttpRequestHeader.AcceptCharset] = "ISO-8859-1,utf-8;q=0.7,*;q=0.3";
var content = ScrubContent(client.DownloadString(args[0]));
if (content == "")
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Name {0} is available", line);
unavailableWriter.WriteLine(line);
AvailableNum++;
Console.Title = "Cookie name checker | by BataBo | Checked: " + (AvailableNum + UnavailableNum) + " | Good:" + AvailableNum;
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Name {0} is not available", line);
availableWriter.WriteLine(line);
UnavailableNum++;
Console.Title = "Cookie name checker | by BataBo | Checked: " + (AvailableNum + UnavailableNum) + " | Good:" + AvailableNum;
}
}
}
}
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("====================Results====================");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("Checked: {0} names", AvailableNum + UnavailableNum);
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Available names: {0} names", AvailableNum);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Unavailable names: {0} names", UnavailableNum);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("====================Results====================");
Console.ReadLine();
}
static string ScrubContent(string content)
{
return new string(content.Where(c => c != '\n').ToArray());
}
}
Can anyone help me?
Continue reading...