Skip to content

Instantly share code, notes, and snippets.

@jashsu
jashsu / spyglass-release.py
Last active August 29, 2015 13:56
Spyglass is an email notification script for the Glass Shop.
#!/usr/bin/env python
""" Spyglass is an email notification script for the Glass Shop.
Setup:
------
Install Python 2.7.x and these additional libraries: requests, lxml.
Enter your own smtp server, smtp login details and notification email
recipient into the relevant fields in Spyglass.__init__. In order for
Spyglass to fetch the page, you will also need to copy the cookie
strings from an authenticated browser session (get this by logging
{
"Type":"UnencryptedConfiguration",
"NetworkConfigurations":[
{
"GUID":"{%GUID_A%}",
"Name":"%NAME%",
"Type":"VPN",
"VPN":{
"Type":"OpenVPN",
"Host":"%HOSTNAME%",
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
// Source File Name: HiddenViewConfiguration.java
package com.google.glass.hidden;
import android.view.ViewConfiguration;
// Referenced classes of package com.google.glass.hidden:
def is_power_of_three(num):
from types import IntType, FloatType
assert type(num) in (IntType, FloatType)
x = 3
if num in (0, 1): return True
elif num < 0: return False
elif num > 0 and num < 1:
while True:
y = 1.0/x #hacky..
#print y, x
{
"canonicalUrl": "http://en.m.wikipedia.org/w/index.php?curid=25658949",
"notification": {
"level": "DEFAULT"
},
"menuItems": [
{
"action": "READ_ALOUD"
},
{
var goog = goog || {};
goog.global = this;
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.TRUSTED_SITE = !0;
goog.provide = function (a) {
goog.exportPath_(a)
};
goog.setTestOnly = function (a) {
if (!goog.DEBUG) throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : ".");
def test_all_apps_link(self):
p = self.init()
self.assert_elem(self.find_elem('xpath', '/div/div/a[1]', p),
{'inner' : 'All Applications',
'attrib': {'href': '/viewProjects.do',
'class': 'title colorMediumBlue hover'},
'invoke': {'is_displayed': True}})
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>> def factorial(n):
if n < 1:
sys.exit
elif n == 1:
return 1
else:
return n * factorial(n-1)