Skip to content

Instantly share code, notes, and snippets.

@lwjef
Last active December 11, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lwjef/4546863 to your computer and use it in GitHub Desktop.
Save lwjef/4546863 to your computer and use it in GitHub Desktop.
Get Bing mkt code.
# http://msdn.microsoft.com/en-us/library/dd251064.aspx
for mkt in "ar-XA" "bg-BG" "cs-CZ" "da-DK" "de-AT" "de-CH" "de-DE" "el-GR" "en-AU" "en-CA" "en-GB" "en-ID" "en-IE" "en-IN" "en-MY" "en-NZ" "en-PH" "en-SG" "en-US" "en-XA" "en-ZA" "es-AR" "es-CL" "es-ES" "es-MX" "es-US" "es-XL" "et-EE" "fi-FI" "fr-BE" "fr-CA" "fr-CH" "fr-FR" "he-IL" "hr-HR" "hu-HU" "it-IT" "ja-JP" "ko-KR" "lt-LT" "lv-LV" "nb-NO" "nl-BE" "nl-NL" "pl-PL" "pt-BR" "pt-PT" "ro-RO" "ru-RU" "sk-SK" "sl-SL" "sv-SE" "th-TH" "tr-TR" "uk-UA" "zh-CN" "zh-HK" "zh-TW"; do
xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=$mkt"
(echo $(curl -s $xmlURL) | grep -o "<urlBase>.\+</urlBase>" | grep "ROW" || echo $mkt) | grep -v "ROW"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment