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
class post(): | |
def __init__(self, id, url, date, caption, link_url, | |
photo1280, photo500, photo250, tag): | |
self.id = id | |
self.url = url | |
self.date = date | |
self.caption = caption | |
self.link_url = link_url | |
self.photo1280 = photo1280 | |
self.photo500 = photo500 |
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
import os, re | |
from datetime import datetime | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import template | |
from google.appengine.ext.webapp.util import run_wsgi_app | |
from google.appengine.api import urlfetch | |
from django.utils import simplejson as json |
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
Traceback (most recent call last): | |
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 507, in __call__ | |
handler.get(*groups) | |
File "/Users/ethan/Pyapps/GAE/tooepic/main.py", line 152, in get | |
tumblr_object = load_tumblr("tehome") | |
File "/Users/ethan/Pyapps/GAE/tooepic/main.py", line 70, in load_tumblr | |
js_object = json.loads(content) | |
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django/django/utils/simplejson/__init__.py", line 232, in loads | |
return cls(encoding=encoding, **kw).decode(s) | |
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django/django/utils/simplejson/decoder.py", line 251, in decode |
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
def load_tumblr(user, tries=2): | |
url = "http://" + user + ".tumblr.com/api/read/json?type=photo&num=20&tagged=project" | |
try: | |
result = urlfetch.fetch(url) | |
""" tumblr outputs the json as a javascript var, so we have to remove | |
junk at the beginning and the semicolon at the end.""" | |
content = result.content.replace("var tumblr_api_read = ", "") | |
content = content[:-2] |
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
// the @media stuff is for viewers on mobile devices | |
html { | |
overflow: hidden; | |
} | |
@media only screen and (max-device-width:480px) { | |
html { | |
overflow: auto; | |
} |
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
tree = ET.fromstring(result.content) | |
redirect_url = tree.findtext("redirect-url") | |
self.redirect(redirect_url) |
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
<html> | |
<head> | |
<title>A CSS Hack, For Neven</title> | |
<style type="text/css"> | |
/* Have one of these for each author on your tumblelog. */ | |
.tooepic:after {content:"Ethan Sherbondy";} | |
.john-appleseed:after {content:"John Appleseed";} | |
/* fallback only displays if css is disabled */ |
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
from google.appengine.ext import db | |
q = db.GqlQuery("SELECT __key__ FROM College") | |
db.delete(q) |
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
appcfg.py upload_data --config_file=college_loader.py --filename=college_list.csv --kind=College --has_header --url=http://localhost:8083/remote_api /Users/ethan/Pyapps/GAE/in-yet |
OlderNewer