Created
February 22, 2010 15:14
-
-
Save andrewheiss/311147 to your computer and use it in GitHub Desktop.
Uses Windows PowerShell to download the Qur'an
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell Qur'an Downloader | |
# | |
# Author: Andrew Heiss - http://www.andrewheiss.com | |
# Project site: http://gist.github.com/311147 | |
# Description: Uses Windows PowerShell to download the Qur'an | |
# License: Licensed under the MIT License (see below) | |
# Date: February 22, 2010 | |
# Version: 1.0 (February 22, 2010) | |
# | |
# | |
#--------------- | |
# INSTRUCTIONS | |
#--------------- | |
# | |
# You must use Windows PowerShell to run this script! | |
# | |
# PowerShell is included in Windows 7. If you're running Vista or XP, you'll need to download PowerShell from http://support.microsoft.com/kb/968929 | |
# | |
# 1. Create the folder where you want to download everything (e.g. C:\Music\Quran\ or whatever) | |
# 2. Save this file as `download.ps1` in the new folder. | |
# 3. Open Windows PowerShell (search for it in the Start menu) | |
# 4. Navigate to the new folder with the script in it (e.g. `cd C:\Music\Quran\`) | |
# 5. You need to lower the permission levels of PowerScript to run any scripts. By default it disallows all scripts. Lame, yes. Type `Set-ExecutionPolicy RemoteSigned` at the prompt. | |
# 6. Finally, type `.\download.ps1` to begin the massive automated download. | |
#---------------- | |
# ACTUAL SCRIPT | |
#---------------- | |
foreach ($i in 1..114 ) { | |
$file = "{0:D3}" -f $i | |
$path = "$pwd\$file.mp3" | |
$url = "http://download.quranicaudio.com/quran/muhammad_siddeeq_al-minshaawee/$file.mp3" | |
"Downloading [$url]`nSaving at [$path]" | |
$client = new-object System.Net.WebClient | |
$client.DownloadFile( $url, $path ) | |
} | |
#---------- | |
# LICENSE | |
#---------- | |
# | |
# PowerShell Qur'an Downloader is licensed under the MIT License: | |
# | |
# Copyright (c) 2010 Andrew Heiss (http://www.andrewheiss.com) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment