This file contains hidden or 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
# coding: utf-8 | |
import MySQLdb | |
connect = MySQLdb.connect(user='root', passwd='', db='blog', host='127.0.0.1', port=3306) | |
cursor = connect.cursor() | |
cursor.execute('SELECT title, content, tags, created FROM blogs') | |
result = cursor.fetchall() |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2, cookielib, hashlib, urllib, json | |
EMAIL = '' | |
PWD = '' | |
URL = 'http://bozpy.sinaapp.com' | |
def post(filename): |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib, urllib2, json | |
RPC_URL = 'http://192.168.1.2/jsonrpc' | |
def pushStream(stream, rpc=RPC_URL): | |
''' | |
Push stream URL to XBMC jsonrpc api, XBMC play the streaming. |
NewerOlder