“Edit with Intype” in context menu

I recently started using Intype instead of ugly old Notepad++. A feature I’ve been missing though, is the “Open with Notepad++” context menu option, but it turns out it’s quite easy to add one!

All you have to do is add a few registry keys. Save the following to a .reg file, change the paths appropriately and run it:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Edit with Intype...]
"Icon"="\"C:\\Program Files (x86)\\Intype\\intype.exe\",0"

[HKEY_CLASSES_ROOT\*\shell\Edit with Intype...\command]
@="\"C:\\Program Files (x86)\\Intype\\intype.exe\" \"%1\""

To any Intype devs reading this, can you please please add a drag and drop feature? Thaaaaanks!

Edit 10/03: Yay! Drag and drop feature added!

Scraping the web with ♥ Python ♥

I have a bunch of reference folders where I dump stuff that inspires me. I use those images as my screensaver which pops up after 3mins or so. Once in a while, I go on an inspiration finding frenzy and fill those up with new stuff.

Here are some of my sources (but not all):
National Geographic POD
Flickr explore last 7 days
Inspire Me Now – Random
Astronomy POD
Earth POD

My favorite must be National Geographic POD. Amazing photography, every single day. But instead of going through manual labor of saving that picture to my ref folder every day (you lazy bastard!), I thought I’d automate it.

Here’s the script I wrote in python that visits the NPOD page each time my PC boots up and saves the image to my reference folder. You’ll need to get the BeautifulSoup python module, which greatly simplifies the code.

import os
import urllib2
import time
from urllib import urlretrieve
from BeautifulSoup import BeautifulSoup

# Make sure we have an internet connection (10 attempts)
#  because we might not be connected when this script runs at startup
for i in range(0, 10):
		print "Connection to interwebs attempt:", i
		urllib2.urlopen("http://google.com", timeout=2)
		print "...succes!"
		print "...failed! Retrying."

# Find today's image in the html doc
url = "http://photography.nationalgeographic.com/photography/photo-of-the-day"
soup = BeautifulSoup(urllib2.urlopen(url).read())
npod_image = None
	# Is there a high resolution wallpaper of today's image available?
	npod_image = soup('div', {'class' : 'download_link'})[0].a['href']
	print "Getting wallpaper image failed"
		# No wallpaper, get the picture
		npod_image = soup('div', {'class' : 'primary_photo'})[0].a.img['src']
		print "Getting main image failed"

# Save the image
script_path = os.path.abspath(os.path.dirname(__file__))
npod_image_dest = os.path.join(script_path, os.path.basename(npod_image))
print "Saving", npod_image, "to...\n   ", npod_image_dest
urlretrieve(npod_image, npod_image_dest)

To make it run at start-up, create a batch file in your startup dir that runs the python script.

C:\Python27\python.exe "E:\Waldo\Pictures\Reference\scripts\npod_scraper.py"

I have a bunch of these scripts that pull stuff in that inspires me every day.

I love python!