自定义图片源规则示例
<p>这是应用内的在线图片源库中,开发者上传的图片源解析规则的例子。</p>
<p>(注:以下示例均对应着“解析规则”项,填入应用中时,需手动为其补上图片源名称、图片源地址、图片源介绍。)</p>
<p>1.随机获取1080P的Unsplash图片:
<em>2023年5月补充:注意,unsplash官方对api进行了变更,此处的api已失效</em></p>
<pre><code>{
&quot;mode&quot;:&quot;0&quot;,
&quot;api&quot;:&quot;https://source.unsplash.com/random/1920x1080&quot;,
&quot;model&quot;:{
&quot;size&quot;:[
{
&quot;default&quot;:&quot;1920x1080&quot;
}
],
&quot;copyright&quot;:[
{
&quot;default&quot;:&quot;Unsplash&quot;
}
]
}
}</code></pre>
<p>2.随机获取不限制分辨率的Unsplash图片:
<em>2023年5月补充:注意,unsplash官方对api进行了变更,此处的api已失效</em></p>
<pre><code>{
&quot;mode&quot;:&quot;0&quot;,
&quot;api&quot;:&quot;https://source.unsplash.com/random&quot;,
&quot;model&quot;:{
&quot;copyright&quot;:[
{
&quot;default&quot;:&quot;Unsplash&quot;
}
]
}
}</code></pre>
<p>3.获取最近8天的带Microsoft水印的必应壁纸</p>
<pre><code>{
&quot;mode&quot;:&quot;0&quot;,
&quot;api&quot;:&quot;https://bingwallpaperimages.azureedge.net/hpimages/Latest/3840x2160/{0}.jpg&quot;,
&quot;para&quot;:[
{
&quot;startdate&quot;:&quot;t&quot;,
&quot;stride&quot;:-1,
&quot;startstride&quot;:-1,
&quot;limit&quot;:8,
&quot;dateformat&quot;:&quot;yyyyMMdd&quot;
}
],
&quot;model&quot;:{
&quot;copyright&quot;:[
{
&quot;default&quot;:&quot;Microsoft Bing&quot;
}
],
&quot;size&quot;:[
{
&quot;default&quot;:&quot;3840x2160&quot;
}
]
}
}</code></pre>
<p>4.360壁纸-4K专区</p>
<pre><code>{
&quot;mode&quot;:&quot;2&quot;,
&quot;api&quot;:&quot;http://wallpaper.apc.360.cn/index.php?c=WallPaper&amp;a=getAppsByCategory&amp;cid=36&amp;start={0}&amp;count=10&amp;from=360chrome&quot;,
&quot;para&quot;:[
{
&quot;start&quot;:0,
&quot;stride&quot;:10
}
],
&quot;path&quot;:[
{
&quot;node&quot;:&quot;data&quot;
}
],
&quot;model&quot;:{
&quot;uri&quot;:[
{
&quot;node&quot;:&quot;url&quot;
}
],
&quot;thumb&quot;:[
{
&quot;node&quot;:&quot;img_1024_768&quot;
}
],
&quot;title&quot;:[
{
&quot;node&quot;:&quot;utag&quot;
}
],
&quot;date&quot;:[
{
&quot;node&quot;:&quot;update_time&quot;
}
],
&quot;dateformat&quot;:&quot;yyyy-MM-dd HH:mm:ss&quot;,
&quot;copyright&quot;:[
{
&quot;default&quot;:&quot;360&quot;
}
],
&quot;size&quot;:[
{
&quot;node&quot;:&quot;resolution&quot;
}
]
}
}</code></pre>