[Polycasso-commit] SF.net SVN: polycasso:[250] trunk/polycasso/src/com/mebigfatguy/polycasso
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2012-04-21 00:23:31
|
Revision: 250
http://polycasso.svn.sourceforge.net/polycasso/?rev=250&view=rev
Author: dbrosius
Date: 2012-04-21 00:23:24 +0000 (Sat, 21 Apr 2012)
Log Message:
-----------
merge from github
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-03-18 02:35:10 UTC (rev 249)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-04-21 00:23:24 UTC (rev 250)
@@ -38,7 +38,7 @@
private static final String ROOTURL = "http://search.lycos.com";
private static final String URL = ROOTURL + "/images/?q={0}";
private static final Pattern IMAGE_HTML_PATTERN = Pattern.compile("\\<a href=\"(/image-preview\\?image=.*)\"");
- private static final Pattern IMAGE_PATTERN = Pattern.compile("<a href=\"([^\"]*)\" title=\"Full-size Image\">");
+ private static final Pattern IMAGE_PATTERN = Pattern.compile("<a href=\"([^\"]*)\" title=\"Full-size image\">");
private static final int NAMELEN = 3;
private static final int ATTEMPTS = 5;
@@ -67,6 +67,7 @@
return findImageAt(MessageFormat.format(URL, new String(ranName)), settings);
} catch (IOException ioe) {
+ ioe.printStackTrace();
}
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2012-03-18 02:35:10 UTC (rev 249)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2012-04-21 00:23:24 UTC (rev 250)
@@ -70,7 +70,10 @@
proxy = Proxy.NO_PROXY;
}
con = (HttpURLConnection)u.openConnection(proxy);
- con.addRequestProperty("User-Agent", "Mozilla/4.76");
+ con.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6");
+ con.addRequestProperty("Accept-Charset", "UTF-8");
+ con.addRequestProperty("Accept-Language", "en-US,en");
+ con.addRequestProperty("Accept", "text/html,image/*");
con.setDoInput(true);
con.setDoOutput(false);
con.connect();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|