代码
用途:需要图片时我们经常是去百度里随便找几张,次数多了就有点烦了,这个工具类就是批量获取几万张图片的url和描述。
public class PicUrls {
private static final String HOST0 = "http://img1.mm131.com/pic/";//网站【http://www.mm131.com/】
private static final String HOST1 = "http://img.mmjpg.com/";//网站【http://www.mmjpg.com/】
private static final String HOST2 = "http://pic.meituba.com/uploads/allimg/";//网站【http://www.meituba.com/】
public static final UrlBean BIG_BEANS_0 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2015/10/23/220.jpg
.host(HOST2).urlHeader("2015/10/23/").picIndexFrom(220).picCount(100).picDes("100张动漫卡通壁纸").build();
public static final UrlBean BIG_BEANS_1 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2017/03/27/121_5600.jpg
.host(HOST2).urlHeader("2017/03/27/121_").picIndexFrom(5600).picCount(100).picDes("100张搞笑内涵图片").build();
public static final UrlBean BIG_BEANS_2 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2015/10/23/360.jpg
.host(HOST2).urlHeader("2015/10/23/").picIndexFrom(360).picCount(750).picDes("750张性感美女写真图片").build();
public static final UrlBean BIG_BEANS_3 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2016/03/25/43_20335.jpg
.host(HOST2).urlHeader("2016/03/25/43_").picIndexFrom(20335).picCount(1400).picDes("1400张动漫卡通壁纸").build();
private static final UrlBean[] simpleBeans = {
//http://img1.mm131.com/pic/996/1.jpg
new UrlBean.Builder().host(HOST0).urlHeader("996/").picCount(10).picDes("北影校花余雨高清写真图片").build(),
new UrlBean.Builder().host(HOST0).urlHeader("2958/").picCount(10).picDes("童颜嫩妹桃子黑丝大尺度诱惑").build(),
new UrlBean.Builder().host(HOST0).urlHeader("2939/").picCount(10).picDes("清纯少女刘奕宁酥胸覆白色内衣").build(),
new UrlBean.Builder().host(HOST0).urlHeader("2343/").picCount(10).picDes("萌妹销魂写真身材惹火让人欲罢不能").build(),
new UrlBean.Builder().host(HOST0).urlHeader("2935/").picCount(10).picDes("性感女神杨晨晨透视睡衣大胆秀乳").build(),
//http://img.mmjpg.com/2015/444/1.jpg
new UrlBean.Builder().host(HOST1).urlHeader("2015/444/").picCount(10).picDes("模范学院美少女柳侑绮制服大片").build(),
new UrlBean.Builder().host(HOST1).urlHeader("2015/74/").picCount(10).picDes("极品女神可儿私拍秀完美身材").build(),
new UrlBean.Builder().host(HOST1).urlHeader("2017/990/").picCount(10).picDes("香艳妹子雪白的美胸绝对让你大饱眼福").build(),
new UrlBean.Builder().host(HOST1).urlHeader("2017/962/").picCount(10).picDes("真诱人啊!女神雪白的美胸看着很有感觉").build(),
new UrlBean.Builder().host(HOST1).urlHeader("2017/936/").picCount(10).picDes("身材娇美纯天然美女小叶子美胸艺术照").build(),
//http://pic.meituba.com/uploads/allimg/2015/10/23/247.jpg
new UrlBean.Builder().host(HOST2).urlHeader("2015/10/23/").picIndexFrom(247).picCount(10).picDes("呆萌可爱的哆啦A梦").build(),
new UrlBean.Builder().host(HOST2).urlHeader("2016/03/25/43_").picIndexFrom(20574).picCount(10).picDes("海贼王红发香克斯").build(),
new UrlBean.Builder().host(HOST2).urlHeader("2016/03/25/44_").picIndexFrom(11275).picCount(10).picDes("英雄联盟图片").build(),
new UrlBean.Builder().host(HOST2).urlHeader("2016/07/30/43_").picIndexFrom(485).picCount(10).picDes("精选超萌小猫咪").build(),
new UrlBean.Builder().host(HOST2).urlHeader("2016/09/08/43_").picIndexFrom(476).picCount(10).picDes("可爱快乐的女孩动漫").build(),
};
//******************************************************************************************
/**
* 10*15张各种各样的带有描述的图片
*/
public static ArrayList<BasicPicBean> getPicList() {
List<UrlBean> urlList = Arrays.asList(simpleBeans);
ArrayList<BasicPicBean> picList = new ArrayList<>();
for (UrlBean bean : urlList) {
picList.addAll(getPicList(bean));
}
return picList;
}
/**
* 每一个UrlBean都有超多图片,多的有几千张
*/
public static ArrayList<BasicPicBean> getPicList(UrlBean bean) {
ArrayList<BasicPicBean> picList = new ArrayList<>();
for (int i = 0; i < bean.picCount; i++) {
String picIndex = "" + (bean.picIndexFrom + i);
for (int j = picIndex.length(); j < bean.minLength; j++) {
if (picIndex.length() < bean.minLength) {
picIndex = "0" + picIndex;
} else break;
}
String picUrl = bean.host + bean.urlHeader + picIndex + bean.urlEnder;//例如.../1.jpg
String picDes = bean.picDes + "-" + i;
picList.add(new BasicPicBean(picUrl, picDes, i));
}
return picList;
}
//******************************************************************************************
static class UrlBean {
public String picDes;//图片描述
public String host;//存放图片的主机地址
public String urlHeader;
public String urlEnder;//默认为= ".jpg"
public int picCount;//此系列图片的数量。所有图片都是以数字命名的,比如1.jpg、2.jpg
public int picIndexFrom;//此系列图片开始的序号位置,默认为1
public int minLength;//如,当为1.jpg时实际为01.jpg或001.jpg
private UrlBean(Builder builder) {
picDes = builder.picDes;
host = builder.host;
urlHeader = builder.urlHeader;
urlEnder = builder.urlEnder;
picCount = builder.picCount;
picIndexFrom = builder.picIndexFrom;
minLength = builder.minLength;
}
static final class Builder {
private String picDes = "包青天作品";
private String host = "";
private String urlHeader = "";
private String urlEnder = ".jpg";//默认为".jpg"
private int picCount = 1;
private int picIndexFrom = 1;
private int minLength = 1;
public Builder() {
}
public Builder urlHeader(String val) {
urlHeader = val;
return this;
}
public Builder urlEnder(String val) {
urlEnder = val;
return this;
}
public Builder picCount(int val) {
picCount = val;
return this;
}
public Builder picIndexFrom(int val) {
picIndexFrom = val;
return this;
}
public Builder minLength(int val) {
minLength = val;
return this;
}
public Builder host(String val) {
host = val;
return this;
}
public Builder picDes(String val) {
picDes = val;
return this;
}
public UrlBean build() {
return new UrlBean(this);
}
}
}
//******************************************************************************************
public static class BasicPicBean {
public String url;
public String name;
public int index;
public BasicPicBean(String url, String name, int index) {
this.url = url;
this.name = name;
this.index = index;
}
}
}
2017-6-7
http://www.mm131.com/
北影校花余雨高清写真图片
http://img1.mm131.com/pic/996/1.jpg
http://img1.mm131.com/pic/996/2.jpg
http://img1.mm131.com/pic/996/3.jpg
http://img1.mm131.com/pic/996/4.jpg
http://img1.mm131.com/pic/996/5.jpg
http://img1.mm131.com/pic/996/6.jpg
http://img1.mm131.com/pic/996/7.jpg
http://img1.mm131.com/pic/996/8.jpg
http://img1.mm131.com/pic/996/9.jpg
http://img1.mm131.com/pic/996/10.jpg
童颜嫩妹桃子黑丝大尺度诱惑
http://img1.mm131.com/pic/2958/1.jpg
http://img1.mm131.com/pic/2958/2.jpg
http://img1.mm131.com/pic/2958/3.jpg
http://img1.mm131.com/pic/2958/4.jpg
http://img1.mm131.com/pic/2958/5.jpg
http://img1.mm131.com/pic/2958/6.jpg
http://img1.mm131.com/pic/2958/7.jpg
http://img1.mm131.com/pic/2958/8.jpg
http://img1.mm131.com/pic/2958/9.jpg
http://img1.mm131.com/pic/2958/10.jpg
清纯少女刘奕宁酥胸覆白色内衣
http://img1.mm131.com/pic/2939/1.jpg
http://img1.mm131.com/pic/2939/2.jpg
http://img1.mm131.com/pic/2939/3.jpg
http://img1.mm131.com/pic/2939/4.jpg
http://img1.mm131.com/pic/2939/5.jpg
http://img1.mm131.com/pic/2939/6.jpg
http://img1.mm131.com/pic/2939/7.jpg
http://img1.mm131.com/pic/2939/8.jpg
http://img1.mm131.com/pic/2939/9.jpg
http://img1.mm131.com/pic/2939/10.jpg
萌妹销魂写真身材惹火让人欲罢不能
http://img1.mm131.com/pic/2343/1.jpg
http://img1.mm131.com/pic/2343/2.jpg
http://img1.mm131.com/pic/2343/3.jpg
http://img1.mm131.com/pic/2343/4.jpg
http://img1.mm131.com/pic/2343/5.jpg
http://img1.mm131.com/pic/2343/6.jpg
http://img1.mm131.com/pic/2343/7.jpg
http://img1.mm131.com/pic/2343/8.jpg
http://img1.mm131.com/pic/2343/9.jpg
http://img1.mm131.com/pic/2343/10.jpg
性感女神杨晨晨透视睡衣大胆秀乳
http://img1.mm131.com/pic/2935/1.jpg
http://img1.mm131.com/pic/2935/2.jpg
http://img1.mm131.com/pic/2935/3.jpg
http://img1.mm131.com/pic/2935/4.jpg
http://img1.mm131.com/pic/2935/5.jpg
http://img1.mm131.com/pic/2935/6.jpg
http://img1.mm131.com/pic/2935/7.jpg
http://img1.mm131.com/pic/2935/8.jpg
http://img1.mm131.com/pic/2935/9.jpg
http://img1.mm131.com/pic/2935/10.jpg
http://www.mmjpg.com/
模范学院美少女柳侑绮制服大片
http://img.mmjpg.com/2015/444/1.jpg
http://img.mmjpg.com/2015/444/2.jpg
http://img.mmjpg.com/2015/444/3.jpg
http://img.mmjpg.com/2015/444/4.jpg
http://img.mmjpg.com/2015/444/5.jpg
http://img.mmjpg.com/2015/444/6.jpg
http://img.mmjpg.com/2015/444/7.jpg
http://img.mmjpg.com/2015/444/8.jpg
http://img.mmjpg.com/2015/444/9.jpg
http://img.mmjpg.com/2015/444/10.jpg
极品女神可儿私拍秀完美身材
http://img.mmjpg.com/2015/74/1.jpg
http://img.mmjpg.com/2015/74/2.jpg
http://img.mmjpg.com/2015/74/3.jpg
http://img.mmjpg.com/2015/74/4.jpg
http://img.mmjpg.com/2015/74/5.jpg
http://img.mmjpg.com/2015/74/6.jpg
http://img.mmjpg.com/2015/74/7.jpg
http://img.mmjpg.com/2015/74/8.jpg
http://img.mmjpg.com/2015/74/9.jpg
http://img.mmjpg.com/2015/74/10.jpg
香艳妹子雪白的美胸绝对让你大饱眼福
http://img.mmjpg.com/2017/990/1.jpg
http://img.mmjpg.com/2017/990/2.jpg
http://img.mmjpg.com/2017/990/3.jpg
http://img.mmjpg.com/2017/990/4.jpg
http://img.mmjpg.com/2017/990/5.jpg
http://img.mmjpg.com/2017/990/6.jpg
http://img.mmjpg.com/2017/990/7.jpg
http://img.mmjpg.com/2017/990/8.jpg
http://img.mmjpg.com/2017/990/9.jpg
http://img.mmjpg.com/2017/990/10.jpg
真诱人啊!女神雪白的美胸看着很有感觉
http://img.mmjpg.com/2017/962/1.jpg
http://img.mmjpg.com/2017/962/2.jpg
http://img.mmjpg.com/2017/962/3.jpg
http://img.mmjpg.com/2017/962/4.jpg
http://img.mmjpg.com/2017/962/5.jpg
http://img.mmjpg.com/2017/962/6.jpg
http://img.mmjpg.com/2017/962/7.jpg
http://img.mmjpg.com/2017/962/8.jpg
http://img.mmjpg.com/2017/962/9.jpg
http://img.mmjpg.com/2017/962/10.jpg
身材娇美纯天然美女小叶子美胸艺术照
http://img.mmjpg.com/2017/936/1.jpg
http://img.mmjpg.com/2017/936/2.jpg
http://img.mmjpg.com/2017/936/3.jpg
http://img.mmjpg.com/2017/936/4.jpg
http://img.mmjpg.com/2017/936/5.jpg
http://img.mmjpg.com/2017/936/6.jpg
http://img.mmjpg.com/2017/936/7.jpg
http://img.mmjpg.com/2017/936/8.jpg
http://img.mmjpg.com/2017/936/9.jpg
http://img.mmjpg.com/2017/936/10.jpg
http://www.meituba.com/
呆萌可爱的哆啦A梦
http://pic.meituba.com/uploads/allimg/2015/10/23/247.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/248.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/249.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/250.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/251.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/252.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/253.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/254.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/255.jpg
http://pic.meituba.com/uploads/allimg/2015/10/23/256.jpg
海贼王红发香克斯
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20574.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20575.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20576.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20577.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20578.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20579.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20580.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20581.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20582.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/43_20583.jpg
英雄联盟图片
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11275.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11276.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11277.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11278.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11279.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11280.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11281.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11282.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11283.jpg
http://pic.meituba.com/uploads/allimg/2016/03/25/44_11284.jpg
精选超萌小猫咪
http://pic.meituba.com/uploads/allimg/2016/07/30/43_485.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_486.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_487.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_488.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_489.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_490.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_491.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_492.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_493.jpg
http://pic.meituba.com/uploads/allimg/2016/07/30/43_494.jpg
可爱快乐的女孩动漫
http://pic.meituba.com/uploads/allimg/2016/09/08/43_476.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_477.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_478.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_479.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_480.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_481.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_482.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_483.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_484.jpg
http://pic.meituba.com/uploads/allimg/2016/09/08/43_485.jpg
2017-7-27