惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recorded Future
Recorded Future
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
T
Threatpost
P
Privacy International News Feed
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
I
Intezer
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Privacy & Cybersecurity Law Blog
A
Arctic Wolf
博客园 - 聂微东
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
H
Help Net Security
S
Schneier on Security
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
月光博客
月光博客
NISL@THU
NISL@THU
A
About on SuperTechFans
Spread Privacy
Spread Privacy
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
G
Google Developers Blog
W
WeLiveSecurity
P
Palo Alto Networks Blog
The Last Watchdog
The Last Watchdog
K
Kaspersky official blog
博客园 - 司徒正美
L
LINUX DO - 热门话题
小众软件
小众软件

Danb Blog

Cheaper Sodastream Gas with a Big Tank June 2026: What I've Been Working On · Danb Blog Running Snyk On Forgejo/Codeberg Actions · Danb Blog Tuta & Proton: An Open Source Client Does Not Result in an Open Source Service · Danb Blog May 2026: What I've Been Working On · Danb Blog 3D Printing Parts for my Greenhouse, Round 2 · Danb Blog Great Devices: Nexus 7 2013 · Danb Blog R36S Console RetroArch Stuck Menu Issue · Danb Blog April 2026: What I've Been Working On · Danb Blog Basic OpenCode Sandboxing with Docker · Danb Blog Games Played in 2025 · Danb Blog March 2026: What I've Been Working On · Danb Blog Shivam Mathur's "node-docker" Images are Awesome for PHP CI · Danb Blog February 2026: What I've Been Working On · Danb Blog Your BookStackApp project was assigned as a project for my Software Architecture course · Danb Blog My Sovol SV08 3D Printer Setup in 2026 · Danb Blog January 2026: What I've Been Working On · Danb Blog Epson Printer: The administrator password you entered was not recognized · Danb Blog Pressure to Follow Process · Danb Blog Online Shopping Email Notifications · Danb Blog My HomeLab Setup in 2026 · Danb Blog Linux Label Printing with the Phomemo D30 · Danb Blog Reporting to the CMA: Google Android Developer Verification · Danb Blog OPNsense & Dnsmasq: Responding with specific DNS servers · Danb Blog An Impromptu Introduction to ZFS Drive Replacement at 1am · Danb Blog Experience with UK Medical Cannabis for Ankylosing Spondylitis · Danb Blog Copyright Takedown for Linking to the "State of Open Source" Report · Danb Blog No, Gumroad Did Not Become Open Source Today · Danb Blog Scripting Monitors (KDE on Fedora) · Danb Blog Amber flags in Open Source & Self-Hosted Projects · Danb Blog LLMs are Directing Open Source Licensing · Danb Blog Games Played in 2024 · Danb Blog Beware of Poison in the Source · Danb Blog Common Misconceptions of the AGPL · Danb Blog Adapting GitHub action PHPUnit tests for Codeberg/Forgejo · Danb Blog Lessons from the Allotment · Danb Blog Futo, Please don't attempt to create your own Open Source Definition · Danb Blog Material You (Dynamic/Adaptive) Colors in Legacy Android Apps · Danb Blog Scripting Monitors (Gnome & Wayland on Fedora) · Danb Blog Retaining a Greenhouse Roof with 3d Printing · Danb Blog Games Played in 2023 · Danb Blog Lessons From Growing Food Indoors · Danb Blog Why the Distinction Between "Open Source" and "Source Available" is Important · Danb Blog Raspberry Pi Camera Module 3 Timelapse · Danb Blog Removing the Rear Seats on a Volvo C30 · Danb Blog Reporting Google's WEI to the CMA · Danb Blog Controlling Default GRUB Boot Option via USB · Danb Blog Creating a Video Home for FOSS Projects · Danb Blog Paying for Search · Danb Blog My Favourite Static Site Deploy Method · Danb Blog PhpStorm (JetBrains IDE) 2023 Linux Scaling · Danb Blog Synology Hibernation with Active Backup for Business and Tailscale · Danb Blog My 2023 HomeLab Setup · Danb Blog Redefining Open Source via "Commercial Open Source" · Danb Blog Moving to Mastodon · Danb Blog Gaining Sponsors · Danb Blog "This is a Low Maintenance Project" · Danb Blog Upgrading my CPU, Ryzen 2600 to 5800x · Danb Blog Migrating Google Photos to my Personal NAS · Danb Blog Scheduling Proxmox Storage to Reduce Disk Activity · Danb Blog Why the Term "Open Source" is Important · Danb Blog Lessons From Working for Myself (9 Months In) · Danb Blog Misrepresenting Open Source for Business Benefit · Danb Blog Cat Images in WebP · Danb Blog My 2022 Workstation Setup · Danb Blog Leaving my Job to Focus on Open Source (For a bit) · Danb Blog A Thanks to Laravel for the LTS Releases · Danb Blog A Quick Overview of Unix-Style Permissions · Danb Blog The Power of currentColor · Danb Blog Dealing With Ankylosing Spondylitis Flareups · Danb Blog Hugo Verbose Dates With Suffixes · Danb Blog
Quickly Getting Placeholder Images With Unsplash Source · Danb Blog
2021-04-19 · via Danb Blog

I often find myself needing a batch of placeholder images when testing or creating dummy content within projects. Unsplash is a great source for these but downloading each image and making them a reasonable size can take time. They do offer an API but it’s highly limited without creating an account and, even then, getting random images will still take multiple requests.

Fortunately, they offer Unsplash Source. This allows easy direct links to images with the idea you can directly use unsplash source images in online projects. This also provides a very simple API to get random images. A request to https://source.unsplash.com/random/400x200?cat will redirect to a 400px wide by 200px high random picture of cat.

Building a Script

The below is a simple bash script uses unsplash source to get $COUNT many (Where $COUNT is the first argument passed when the script is called) images from unsplash. A second/third/fourth argument, for width/height/topic respectively, can be passed. A delay is added between image fetches to decrease the chances of duplicate images appearing.

#!/bin/bash

# Argument Variables
COUNT=$1
WIDTH=${2:-"1200"}
HEIGHT=${3:-"600"}
TOPIC=${4:-""}

# Show help when now arguments are passed
if [ -z "$COUNT" ]
then
    echo "--- unsplash-get ---"
    echo "Usage:   unsplash-get <count> [width=1200] [height=600] [topic]"
    echo "Example: unsplash-get 50"
    echo "Example: unsplash-get 5 250 250 cats"
    echo "--------------------"
    exit 0;
fi

# Adjust filename to include topic if provided
PREFIX="${TOPIC}_"
if [ -z "$TOPIC" ]
then
    PREFIX=""
fi

# Get our images
for i in $(seq 1 $COUNT)
do
    echo "Fetching image ${i} of ${COUNT}"
    curl -sL "https://source.unsplash.com/random/${WIDTH}x${HEIGHT}?${TOPIC}" > "${PREFIX}image_${WIDTH}x${HEIGHT}_$i.jpg"
    sleep 0.6
done