Last active
August 21, 2016 07:36
-
-
Save wandersick/31903063b0686317d95ccaf05176db9a to your computer and use it in GitHub Desktop.
Publish quotes as blog posts to Google Blogger using GoogleCL - Windows (Deprecated)
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
:: Script: quotes_en.bat (deprecated) | |
:: Version: 1.0 - 20110227 | |
:: Platform: Windows | |
:: Databases: quotes_en_number, quotes_en.ini | |
:: Creator: wandersick - https://wandersick.blogspot.com/2016/08/auto-posting-inspirational-quotes-on.html | |
:: Purpose: Publish quotes as blog posts to Google Blogger using GoogleCL (Windows) | |
:: | |
:: Usage: Save this script and quotes in the same folder. | |
:: google.exe (GoogleCL) should be in system enviromental path. | |
:: Change 'English Quotes' to your blog name. | |
:: Ensure write access is permitted to quotes_en_number (generated by script on first run) | |
:: | |
:: Quotes formatted as below should be saved in a text file named quotes_en.ini. Run/schedule this script on Windows. | |
:: | |
:: "Hold faithfulness and sincerity as first principles."= Confucius | |
:: "Peace cannot be kept by force. It can only be achieved by understanding."= Albert Einstein | |
@echo off | |
:: go to working dir | |
cd /d %~p0 | |
if not exist quotes_en_number echo 0 >quotes_en_number | |
for /f "usebackq" %%i in (`type quotes_en_number`) do set skip=%%i&set skipNum=%%i | |
if %skip% EQU 0 ( | |
set skip= | |
) else ( | |
set skip=skip=%skip% | |
) | |
for /f "%skip% usebackq tokens=1,2 delims==" %%i in (`type "quotes_en.ini"`) do ( | |
google blogger post --title "%%j" --blog "English Quotes" --tags "%%j" "<p>%%i%%j</p>" | |
goto :skip | |
) | |
:skip | |
set /a skipNum+=1 | |
echo %skipNum% > quotes_en_number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment