Created
February 24, 2019 17:40
-
-
Save Lucas7yoshi/351657676a21ff6c219dfef67fecd294 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
using System; | |
using System.Net; | |
using System.Threading.Tasks; | |
namespace ImageFinder | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//https://cdn2.unrealengine.com/Fortnite/fortnite-game/battleroyalenews/v60/BR06_MOTD_S62-1024x512-3321ee55a8246cab8e31a306a77918a2cd0ea8de.jpg | |
Run().GetAwaiter().GetResult(); | |
Console.ReadLine(); | |
} | |
public static async Task Run() | |
{ | |
int count = 0; | |
while (true) | |
{ | |
var og = "https://cdn2.unrealengine.com/Fortnite/fortnite-game/battleroyalenews/v740+HF/BR08_MOTD_BPLaunch_Teaser_Hook_Day2-1022x512-"; | |
var url = og + CreateString(40) + ".jpg"; | |
//url = "https://cdn2.unrealengine.com/Fortnite/fortnite-game/battleroyalenews/v740+HF/BR08_MOTD_BPLaunch_Teaser_Hook_Day1-1022x512-1521ae107a4b7ca0e423d2a2ff24543066412507.jpg"; | |
bool answer = checkWebsite(url); | |
if (!answer) | |
{ | |
Console.WriteLine("Failed: " + url + " " + count); | |
} | |
else | |
{ | |
Console.WriteLine("HOLY SHIT SUCCESS!!!" + url); | |
Console.ReadLine(); | |
} | |
await Task.Delay(1); | |
count += 1; | |
} | |
} | |
public static async Task Test() | |
{ | |
var og = "https://cdn2.unrealengine.com/Fortnite/fortnite-game/battleroyalenews/v60/BR06_MOTD_S61-1024x512-"; | |
var url = og + CreateString(40) + ".jpg"; | |
bool answer = checkWebsite(url); | |
if (!answer) | |
{ | |
Console.WriteLine("Failed: " + url); | |
} | |
else | |
{ | |
Console.WriteLine("HOLY SHIT SUCCESS!!!" + url); | |
Console.ReadLine(); | |
} | |
} | |
public static bool checkWebsite(string URL) | |
{ | |
try | |
{ | |
WebClient wc = new WebClient(); | |
string HTMLSource = wc.DownloadString(URL); | |
return true; | |
} | |
catch (Exception) | |
{ | |
return false; | |
} | |
} | |
static Random rd = new Random(); | |
internal static string CreateString(int stringLength) | |
{ | |
const string allowedChars = "abcde0123456789"; | |
char[] chars = new char[stringLength]; | |
for (int i = 0; i < stringLength; i++) | |
{ | |
chars[i] = allowedChars[rd.Next(0, allowedChars.Length)]; | |
} | |
return new string(chars); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment