Jump to content

Imgur Link Generator


Reid

Recommended Posts

Generates valid imgur links smile.png

 

go nuts

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * Imgur Link Generator
 * 
 * @author Reid
 * @date 4/19/2015
 * 
 */
public class ImgurLinkGenerator {

	public static void main(String[] args) throws IOException, URISyntaxException {
		while(true) {
			validatePage();			
		}
	}

	private static void validatePage() throws IOException, URISyntaxException {
		final String genURL = generateURL();
		final URL url = new URL(genURL);
		final BufferedReader file = new BufferedReader(new InputStreamReader(url.openStream()));
		String line;
		line = file.readLine();
		if (!line.equals("‰PNG")) {
			System.out.println(genURL);
		}
	}

	private static String generateURL() {
		final char ch[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
		final String url = "http://i.imgur.com/";
		int randChar = 0;
		String randomGen = "";
		for (int i = 0; i < 5; i++) {
			randChar = (int) (Math.random() * ch.length);
			randomGen += ch[randChar];
		}
		return url + randomGen + ".png";
	}
}
Some photos may be NSFW

http://i.imgur.com/mgtvq.png
http://i.imgur.com/cwydp.png
http://i.imgur.com/sfami.png
http://i.imgur.com/ymufr.png
http://i.imgur.com/uowsw.png
http://i.imgur.com/ajfvy.png
http://i.imgur.com/errui.png
http://i.imgur.com/vmrox.png
http://i.imgur.com/rncun.png
http://i.imgur.com/jpodl.png
http://i.imgur.com/kuzme.png
http://i.imgur.com/fkhsl.png
http://i.imgur.com/pikyp.png
http://i.imgur.com/hpifq.png
http://i.imgur.com/afllu.png
http://i.imgur.com/cywes.png
http://i.imgur.com/omqsv.png
http://i.imgur.com/wmeiv.png
http://i.imgur.com/vlbut.png
http://i.imgur.com/zqwft.png
http://i.imgur.com/rqsip.png
http://i.imgur.com/ioslh.png
http://i.imgur.com/jjyst.png
http://i.imgur.com/heidv.png
http://i.imgur.com/gpfhz.png
http://i.imgur.com/dkorl.png
http://i.imgur.com/kgwzp.png
http://i.imgur.com/hlblf.png
http://i.imgur.com/aktax.png
http://i.imgur.com/uxyqc.png
http://i.imgur.com/xzxen.png
http://i.imgur.com/awdfq.png
http://i.imgur.com/tydkc.png
http://i.imgur.com/iuuhn.png
http://i.imgur.com/dfcdx.png
http://i.imgur.com/jwccy.png
http://i.imgur.com/wyvow.png
http://i.imgur.com/xshfh.png
http://i.imgur.com/wdnai.png
http://i.imgur.com/coxmf.png
http://i.imgur.com/pfztl.png
http://i.imgur.com/hovjm.png
http://i.imgur.com/puzgo.png
http://i.imgur.com/eddpc.png
http://i.imgur.com/hddox.png
http://i.imgur.com/rhcny.png

Edited by Reid
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...