code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env python
import cgi
import urllib
import urllib2
import httplib
from xml.dom import minidom
form = cgi.FieldStorage()
xml = minidom.parse('datos.xml')
resultados = xml.getElementsByTagName('entrada')
json = '{"equipos":['
for i in range(15):
local = resultados[i].getElementsByTagName('equipoA')
visi... | Python |
import feedparser
rss = feedparser.parse("http://barrapunto.com/barrapunto.rss")
for i in rss.entries:
print i.date
print i.title
print " "
| Python |
#!/usr/bin/env python
import urllib
import urllib2
from xml.dom import minidom
parametros = urllib.urlencode({"_query":"//item/title","_wrap":"yes","_indent":"yes"})
respuesta = urllib2.urlopen("http://localhost:8080/exist/rest/db/rss/?"+parametros)
salida = minidom.parseString(respuesta.read())
for i in salida.get... | Python |
import feedparser
rss = feedparser.parse("http://discorporating.blogspot.com/feeds/posts/default")
for i in rss.entries:
print i.date
print i.title
print " "
| Python |
#!/usr/bin/python
import cgi
print "Content-type: text/json\n"
parametros = cgi.FieldStorage()
n = int(parametros["n"].value)
json = '{"Tabla":'+str(n)
for i in range(11):
valor = n*i
json = json + ',"Valor'+str(i)+'":'+str(valor)
json = json + '}'
print json
| Python |
#!/usr/bin/python
import cgi
print "Content-type: text/xml\n"
parametros = cgi.FieldStorage()
n = int(parametros["n"].value)
print "<tabla id='"+str(n)+"'>"
for i in range(11):
valor = n*i
print "<valorx"+str(i)+">"+str(valor)+"</valorx"+str(i)+">"
print "</tabla>"
| Python |
#!/usr/bin/python
import cgi
print "Content-type: text/json\n"
parametros = cgi.FieldStorage()
n = int(parametros["n"].value)
json = '{"Tabla":'+str(n)
for i in range(11):
valor = n*i
json = json + ',"Valor'+str(i)+'":'+str(valor)
json = json + '}'
print json
| Python |
#!/usr/bin/python
import cgi
print "Content-type: text/xml\n"
parametros = cgi.FieldStorage()
n = int(parametros["n"].value)
print "<tabla id='"+str(n)+"'>"
for i in range(11):
valor = n*i
print "<valorx"+str(i)+">"+str(valor)+"</valorx"+str(i)+">"
print "</tabla>"
| Python |
#!/usr/bin/env python
"""
RSS.py
Classes for working with RSS channels as arbitrary data structures.
Requires Python 2.2 or newer and PyXML 0.7.1 or newer.
ChannelBase - Base class for RSS Channels.
CollectionChannel - RSS Channel modeled as a URI-per-entry
dictionary.
TrackingChannel - RS... | Python |
#!/usr/bin/env python
"""
RSS.py
Classes for working with RSS channels as arbitrary data structures.
Requires Python 2.2 or newer and PyXML 0.7.1 or newer.
ChannelBase - Base class for RSS Channels.
CollectionChannel - RSS Channel modeled as a URI-per-entry
dictionary.
TrackingChannel - RS... | Python |
#!/usr/bin/env python
import urllib
import urllib2
from xml.dom import minidom
parametros = urllib.urlencode({"_query":"//item","_wrap":"yes","_indent":"yes","_howmany":"2"})
respuesta = urllib2.urlopen("http://localhost:8080/exist/rest/db/rss/?"+parametros)
salida = minidom.parseString(respuesta.read())
for i in s... | Python |
#!/usr/bin/env python
import urllib
import urllib2
import httplib
from xml.dom import minidom
modificacion = """<xupdate:modifications version="1.0" xmlns:xupdate="http://www.xmldb.org/xupdate">
<xupdate:insert-before select="//item[1]" >
<xupdate:element name="item">
<xupdate:element name="title">El origen de P... | Python |
#!/usr/bin/env python
import urllib
import urllib2
from xml.dom import minidom
parametros = urllib.urlencode({"_query":"//item/link","_wrap":"yes","_indent":"yes"})
respuesta = urllib2.urlopen("http://localhost:8080/exist/rest/db/rss/?"+parametros)
salida = minidom.parseString(respuesta.read())
for i in salida.getE... | Python |
#!/usr/bin/env python
import urllib
import urllib2
from xml.dom import minidom
parametros = urllib.urlencode({"_query":"//item/title","_wrap":"yes","_indent":"yes"})
respuesta = urllib2.urlopen("http://localhost:8080/exist/rest/db/rss/?"+parametros)
salida = minidom.parseString(respuesta.read())
for i in salida.get... | Python |
#!/usr/bin/env python
import urllib
import urllib2
import httplib
from xml.dom import minidom
modificacion = """<xupdate:modifications version="1.0" xmlns:xupdate="http://www.xmldb.org/xupdate">
<xupdate:insert-before select="//item[1]" >
<xupdate:element name="item">
<xupdate:element name="title">El origen de P... | Python |
import libxml2
doc = libxml2.parseFile("habitaciones2.xml")
ctxt = doc.xpathNewContext()
res = ctxt.xpathEval("//puerta/@a")
#res = ctxt.xpathEval("//habitacion")
print 'Hay '+str(len(res))+' puertas que dan:'
for destino in res:
print str(destino)
doc.freeDoc()
ctxt.xpathFreeContext()
| Python |
import libxml2
doc = libxml2.parseFile("clasificacion.xml")
ctxt = doc.xpathNewContext()
nombres = ctxt.xpathEval("//equipo/nombre")
puntos = ctxt.xpathEval("//equipo/puntos")
for i in range(4):
print str(nombres[i].content)+': '+str(puntos[i].content)
doc.freeDoc()
ctxt.xpathFreeContext()
| Python |
from RSS import ns, CollectionChannel, TrackingChannel
#Creamos lo que se llama un Tracking Channel
tc = TrackingChannel()
#Leemos el feed
tc.parse("http://barrapunto.com/barrapunto.rss")
RSS10_TITLE = (ns.rss10, 'title')
#Sacamos los items e iteramos
items = tc.listItems()
for item in items:
item_data = tc.getIte... | Python |
from SOAPpy import *
#Especificamos el archivo WSDL
#WSDLFile = "http://www.webservicex.net/geoipservice.asmx?WSDL"
WSDLFile = "http://www.restfulwebservices.net/wcf/WeatherForecastService.svc?wsdl"
server = WSDL.Proxy(WSDLFile)
#Descomentar para imprimir los metodos disponibles
#print proxy.methods.keys()
#Esto dev... | Python |
import xmlrpclib
#Vamos a crear un XML en Exist mediante su interfaz XML-RPC
#Creamos el objeto servidor
server_url = 'http://localhost:8080/exist/xmlrpc'
server = xmlrpclib.ServerProxy(server_url)
#Creamos el XML
xml = """<?xml version="1.0" encoding="iso-8859-1"?>
<datos>
<cosa>Una</cosa>
</datos>"""
#Lo subimo... | Python |
#!/usr/bin/python
# coding: UTF-8
import urllib2
import urllib
from xml.dom import minidom
#Mostramos la cabecera del programa
print 'Solicitud de busqueda en IMdB, by Julio Navarro'
print '***********************************************'
#Solicitamos la introduccion de una pelicula a buscar
titulo = raw_input('Int... | Python |
#!/usr/bin/env python
import xmlrpclib
url="http://aapugr.wordpress.com/xmlrpc.php"
server = xmlrpclib.ServerProxy(url)
#Tomamos los 5 posts mas recientes
posts=server.metaWeblog.getRecentPosts(24,'aapugr','ugr_aap',5)
for post in posts:
print "Titulo:"+post['title']
print "Link:"+post['permaLink']
print post['d... | Python |
import urllib
import urllib2
#Por si queremos incluir parametros
#parametros = urllib.urlencode({"tag":tag,"count":})
respuesta = urllib2.urlopen("https://aap_ugr:aula-16@api.del.icio.us/v1/posts/recent?")
salida = respuesta.read()
print salida
| Python |
#!/usr/bin/env python
import xmlrpclib
url="http://aapugr.wordpress.com/xmlrpc.php"
server = xmlrpclib.ServerProxy(url)
#Tomamos los 5 posts mas recientes
posts=server.metaWeblog.getRecentPosts(24,'aapugr','ugr_aap',5)
for post in posts:
print "Titulo:"+post['title']
print "Link:"+post['permaLink']
print post['d... | Python |
#!/usr/bin/python
# coding: UTF-8
import urllib2
import urllib
from xml.dom import minidom
#Mostramos la cabecera del programa
print 'Solicitud de busqueda en IMdB, by Julio Navarro'
print '***********************************************'
#Solicitamos la introduccion de una pelicula a buscar
titulo = raw_input('Int... | Python |
import xmlrpclib
url="http://aapugr.wordpress.com/xmlrpc.php"
server = xmlrpclib.ServerProxy(url)
#Subimos un borrador
#datos = pack('ss','Titulo de prueba','Texto de prueba') #Intento fallido de empaquetar con el paquete struct
datos = {'title':'Malditos struct!!','description':'Soy Julio, al final ha funcionado','c... | Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import urllib
import sys
from xml.dom.minidom import parseString
f = urllib.urlopen('https://aap_ugr:aula-16@api.del.icio.us/v1/posts/recent').read()
arbol = parseString(f)
print "Lista de los últimos enlaces de aap_ugr:"
child = arbol.getElementsByTagName("posts")[0]
for i... | Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import urllib
import sys
from xml.dom.minidom import parseString
f = urllib.urlopen('https://aap_ugr:aula-16@api.del.icio.us/v1/posts/recent').read()
arbol = parseString(f)
print "Lista de los últimos enlaces de aap_ugr:"
child = arbol.getElementsByTagName("posts")[0]
for i... | Python |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.4 or later
Recommended: CJKCodecs and iconv_codec <http://cjkpytho... | Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
import feedparser
d = feedparser.parse(sys.argv[1])
for i in d['entries']:
print " * " +i['title']
| Python |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.4 or later
Recommended: CJKCodecs and iconv_codec <http://cjkpytho... | Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
import feedparser
d = feedparser.parse(sys.argv[1])
for i in d['entries']:
print " * " +i['title']
| Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
from xml.dom.minidom import parseString
f = open(sys.argv[1],"r").read()
arbol = parseString(f)
for i in arbol.getElementsByTagName("habitacion"):
print "* " + i.attributes.getNamedItem("id").value
| Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
from xml.dom.minidom import parseString
f = open(sys.argv[1],"r").read()
arbol = parseString(f)
for i in arbol.getElementsByTagName("habitacion"):
print "* " + i.attributes.getNamedItem("id").value
| Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
import urllib2
from xml.dom.minidom import parseString
f = urllib2.urlopen(sys.argv[1]).read()
arbol = parseString(f)
for i in arbol.getElementsByTagName("item"):
print " * " + i.getElementsByTagName("title")[0].firstChild.nodeValue
| Python |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
import urllib2
from xml.dom.minidom import parseString
f = urllib2.urlopen(sys.argv[1]).read()
arbol = parseString(f)
for i in arbol.getElementsByTagName("item"):
print " * " + i.getElementsByTagName("title")[0].firstChild.nodeValue
| Python |
import libxml2
doc = libxml2.parseFile('t212.xml')
for nombreHabitacion in doc.xpathEval('//habitacion[@puerta="pasillo"]'):
print nombreHabitacion.content
| Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import make_parser
from xml.sax.saxutils import XMLGenerator
class Handler(XMLGenerator):
def startElement(self, name, attr):
name = self.traducir(name)
XMLGenerator.startElement(self, name, attr)
def endElement(self, name):
name = self.traducir(name)
... | Python |
#! /usr/bin/env python
# encoding=utf-8
import cgi
import urllib
import feedparser
import jsonpickle
url = cgi.FieldStorage()['url'].value
feed = jsonpickle.encode(feedparser.parse(url))
print 'Content-Type: text/plain'
print
print feed | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.dom.ext.reader import Sax2
from xml import xpath
doc = Sax2.FromXmlFile('micasa.xml').documentElement
for nodo in xpath.Evaluate('//habitacion[position() <= 2]', doc):
print nodo.getAttribute('id') | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import make_parser
from xml.sax.saxutils import XMLGenerator
import cgi
import os
if cgi.FieldStorage()['mode'].value == 'modify':
id = cgi.FieldStorage()['id'].value
content = cgi.FieldStorage()['content'].value
class Handler(XMLGenerator):
def __init__(sel... | Python |
#! /usr/bin/env python
from feedparser import parse
# Funciona con RSS y Atom
# RSS 2 => http://www.enchufa2.es/feed
# Atom => http://www.enchufa2.es/feed/atom
feed = parse('http://www.enchufa2.es/feed')
for item in feed['items']:
print item.title
print item.date + "\n" | Python |
#! /usr/bin/env python
# encoding=utf-8
import cgi
import urllib
url = cgi.FieldStorage()['url'].value
feed = urllib.urlopen(url).read()
print 'Content-Type: application/xml+rss'
print
print feed | Python |
#! /usr/bin/env python
import xml.etree.ElementTree as x
import sys
tree = x.parse(open(sys.argv[1]))
for element in tree.iter():
if element.tag == 'habitacion':
print element.attrib['id'] | Python |
#! /usr/bin/env python
from feedparser import parse
# Funciona con RSS y Atom
# RSS 2 => http://www.enchufa2.es/feed
# Atom => http://www.enchufa2.es/feed/atom
feed = parse('http://www.enchufa2.es/feed')
for item in feed['items']:
print item.title
print item.date + "\n" | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import make_parser
from xml.sax.saxutils import XMLGenerator
class Handler(XMLGenerator):
def startElement(self, name, attr):
name = self.traducir(name)
XMLGenerator.startElement(self, name, attr)
def endElement(self, name):
name = self.traducir(name)
... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.dom.ext.reader import Sax2
from xml import xpath
doc = Sax2.FromXmlFile('micasa.xml').documentElement
for nodo in xpath.Evaluate('//habitacion[position() <= 2]', doc):
print nodo.getAttribute('id') | Python |
#! /usr/bin/env python
import xml.etree.ElementTree as x
import sys
tree = x.parse(open(sys.argv[1]))
for element in tree.iter():
if element.tag == 'habitacion':
print element.attrib['id'] | Python |
#! /usr/bin/env python
# encoding=utf-8
import cgi
import urllib
import feedparser
import jsonpickle
url = cgi.FieldStorage()['url'].value
feed = jsonpickle.encode(feedparser.parse(url))
print 'Content-Type: text/plain'
print
print feed | Python |
#! /usr/bin/env python
# encoding=utf-8
import cgi
print 'Content-Type: application/xml+rss'
print
print '''\
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.dom.ext.reader import Sax2
from xml import xpath
import sys
doc = Sax2.FromXmlFile('micasa.xml').documentElement
for nodo in xpath.Evaluate('//habitacion[puerta[@a="' + sys.argv[1] + '"]]', doc):
print nodo.getAttribute('id') | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import make_parser
from xml.sax.saxutils import XMLGenerator
import cgi
import os
if cgi.FieldStorage()['mode'].value == 'modify':
id = cgi.FieldStorage()['id'].value
content = cgi.FieldStorage()['content'].value
class Handler(XMLGenerator):
def __init__(sel... | Python |
#! /usr/bin/env python
# encoding=utf-8
import cgi
import urllib
url = cgi.FieldStorage()['url'].value
feed = urllib.urlopen(url).read()
print 'Content-Type: application/xml+rss'
print
print feed | Python |
#! /usr/bin/env python
# encoding=utf-8
import cgi
print 'Content-Type: application/xml+rss'
print
print '''\
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.dom.ext.reader import Sax2
from xml import xpath
import sys
doc = Sax2.FromXmlFile('micasa.xml').documentElement
for nodo in xpath.Evaluate('//habitacion[puerta[@a="' + sys.argv[1] + '"]]', doc):
print nodo.getAttribute('id') | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import parseString
from xml.sax.handler import ContentHandler
from urllib import urlopen
class Handler(ContentHandler):
def startElement(self, name, attrs):
if name == 'post':
print attrs.getValue(u'time'), '->', attrs.getValue(u'href')
url = 'https://xxxx:... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xmlrpclib import ServerProxy
username = 'aapugr'
password = 'ugr_aap'
server = ServerProxy('http://aapugr.wordpress.com/xmlrpc.php')
post = server.metaWeblog.getRecentPosts(1, username, password, 1)[0]
print 'Último post:', post['postid']
print 'Título:', post['title']
p... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import parseString
from xml.sax.handler import ContentHandler
from urllib import urlopen
class Handler(ContentHandler):
def __init__(self):
self.name = [False, None]
self.location = [False, None]
self.url = [False, None]
self.text = False
def startElem... | Python |
#! /usr/bin/env python
# encoding=utf-8
from suds.client import Client
api = 'asdf'
url = 'http://api.bing.net/search.wsdl?AppID='+api
client = Client(url)
print client
request = client.factory.create('SearchRequest')
request.parameters.AppId = api
sourcetype = client.factory.create('SourceType')
arraysource = cl... | Python |
#! /usr/bin/env python
# encoding=utf-8
from suds.client import Client
api = 'asdf'
url = 'http://api.bing.net/search.wsdl?AppID='+api
client = Client(url)
print client
request = client.factory.create('SearchRequest')
request.parameters.AppId = api
sourcetype = client.factory.create('SourceType')
arraysource = cl... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xmlrpclib import ServerProxy
server = ServerProxy('http://admin:existe@localhost:8081/exist/xmlrpc')
print server.describeCollection('/db/aap')
#xml = raw_input('Introduzca el documento XML: ')
xml = '''\
<datos>
<cosa>asdfad</cosa>
</datos>'''
server.parse(xml, '/db/aa... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xmlrpclib import ServerProxy
username = 'aapugr'
password = 'ugr_aap'
server = ServerProxy('http://aapugr.wordpress.com/xmlrpc.php')
post = server.metaWeblog.getRecentPosts(1, username, password, 1)[0]
print 'Último post:', post['postid']
print 'Título:', post['title']
p... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import parseString
from xml.sax.handler import ContentHandler
from urllib import urlopen
class Handler(ContentHandler):
def startElement(self, name, attrs):
if name == 'post':
print attrs.getValue(u'time'), '->', attrs.getValue(u'href')
url = 'https://xxxx:... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xml.sax import parseString
from xml.sax.handler import ContentHandler
from urllib import urlopen
class Handler(ContentHandler):
def __init__(self):
self.name = [False, None]
self.location = [False, None]
self.url = [False, None]
self.text = False
def startElem... | Python |
#! /usr/bin/env python
# encoding=utf-8
from xmlrpclib import ServerProxy
server = ServerProxy('http://admin:existe@localhost:8081/exist/xmlrpc')
print server.describeCollection('/db/aap')
#xml = raw_input('Introduzca el documento XML: ')
xml = '''\
<datos>
<cosa>asdfad</cosa>
</datos>'''
server.parse(xml, '/db/aa... | Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
import httplib
from xml.dom import minidom
form = cgi.FieldStorage()
if form.has_key('user'): name=form.getvalue('user')
if form.has_key('pass'): passwd=form.getvalue('pass')
#Chequeamos el registro. Necesitamos la BD.
parametros = urllib.urlencode({"_qu... | Python |
#!/usr/bin/env python
import cgi
print """\
Content-Type: text/plain\n
Funciona
"""
| Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
form = cgi.FieldStorage()
if form.has_key('buscar'): titulo=form.getvalue('buscar')
#Consultamos a IMdB
parametros = urllib.urlencode({"t":titulo,"plot":"full","tomatoes":"true"})
#url = '/?t='+titulo+'&plot=full&tomatoes=true'
#solicitud = urllib2.Reque... | Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
import httplib
from xml.dom import minidom
form = cgi.FieldStorage()
if form.has_key('pelicula'): pel=form.getvalue('pelicula')
if form.has_key('usuario'): user=form.getvalue('usuario')
if form.has_key('comentario'): comment=form.getvalue('comentario')
if... | Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
import httplib
from xml.dom import minidom
form = cgi.FieldStorage()
if form.has_key('user'): name=form.getvalue('user')
if form.has_key('pass'): passwd=form.getvalue('pass')
#Chequeamos el registro. Necesitamos la BD.
parametros = urllib.urlencode({"_qu... | Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
from xml.dom import minidom
form = cgi.FieldStorage()
if form.has_key('buscar'): pel=form.getvalue('buscar')
pel = pel.lower()
#Chequeamos el registro. Necesitamos la BD.
parametros = urllib.urlencode({"_query":"//pelicula[@name='"+pel+"']","_wrap":"no... | Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
form = cgi.FieldStorage()
if form.has_key('buscar'): titulo=form.getvalue('buscar')
#Consultamos a IMdB
parametros = urllib.urlencode({"t":titulo,"plot":"full","tomatoes":"true"})
#url = '/?t='+titulo+'&plot=full&tomatoes=true'
#solicitud = urllib2.Reque... | Python |
#!/usr/bin/env python
import cgi
print """\
Content-Type: text/plain\n
Funciona
"""
| Python |
from xml.dom import minidom
#Tratamiento del XML
def leer_pelicula(nombre):
pelis = xml.getElementsByTagName('film')
for peli in pelis:
if peli.attributes['title'].nodeValue == nombre:
print peli.attributes['title'].nodeValue
xml = minidom.parse("films.xml");
leer_pelicula('Stalker')
| Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
import httplib
from xml.dom import minidom
form = cgi.FieldStorage()
if form.has_key('pelicula'): pel=form.getvalue('pelicula')
if form.has_key('usuario'): user=form.getvalue('usuario')
if form.has_key('comentario'): comment=form.getvalue('comentario')
if... | Python |
#!/usr/bin/env python
import cgi
import urllib
import urllib2
from xml.dom import minidom
form = cgi.FieldStorage()
if form.has_key('buscar'): pel=form.getvalue('buscar')
pel = pel.lower()
#Chequeamos el registro. Necesitamos la BD.
parametros = urllib.urlencode({"_query":"//pelicula[@name='"+pel+"']","_wrap":"no... | Python |
#!/usr/bin/env python
import cgi
form = cgi.FieldStorage()
if form.has_key('user'): nombre=form.getvalue('user')
if form.has_key('pass'): passwd=form.getvalue('pass')
#Chequeamos el registro. Necesitamos la BD.
loginOK=True
if loginOK==True:
print """\
Content-Type: text/plain\n
LoginOK
"""
else:
print """\
C... | Python |
#!/usr/bin/env python
import cgi
form = cgi.FieldStorage()
if form.has_key('user'): nombre=form.getvalue('user')
if form.has_key('pass'): passwd=form.getvalue('pass')
#Chequeamos el registro. Necesitamos la BD.
loginOK=True
if loginOK==True:
print """\
Content-Type: text/plain\n
LoginOK
"""
else:
print """\
C... | Python |
#!/usr/bin/env python
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/licenses/lgpl.html
# ... | Python |
#!/usr/bin/env python
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/licenses/lgpl.html
# ... | Python |
#!/usr/bin/env python
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/licenses/lgpl.html
# ... | Python |
#!/usr/bin/env python
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/licenses/lgpl.html
# ... | Python |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.4 or later
Recommended: CJKCodecs and iconv_codec <http://cjkpytho... | Python |
#!/usr/bin/python
import feedparser
import sys
entrada = feedparser.parse(sys.argv[1])
for i in entrada['entries']:
print " * " +i['title']
| Python |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.4 or later
Recommended: CJKCodecs and iconv_codec <http://cjkpytho... | Python |
#!/usr/bin/python
import feedparser
import sys
entrada = feedparser.parse(sys.argv[1])
for i in entrada['entries']:
print " * " +i['title']
| Python |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "miniupload.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
"""
Tweepy Twitter API library
"""
__version__ = '1.9'
__author__ = 'Joshua Roesslein'
__license__ = 'MIT'
from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResult, ModelFactory
from tweepy.error import Twee... | Python |
# Tweepy
# Copyright 2010 Joshua Roesslein
# See LICENSE for details.
from datetime import datetime
import time
import htmlentitydefs
import re
import locale
from urllib import quote
def parse_datetime(string):
# Set locale for date parsing
locale.setlocale(locale.LC_TIME, 'C')
# We must parse datetime ... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from urllib2 import Request, urlopen
import base64
from tweepy import oauth
from tweepy.error import TweepError
from tweepy.api import API
class AuthHandler(object):
def apply_auth(self, url, method, headers, parameters):
"""App... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import os
import mimetypes
from tweepy.binder import bind_api
from tweepy.error import TweepError
from tweepy.parsers import ModelParser, RawParser
from tweepy.utils import list_to_csv
class API(object):
"""Twitter API"""
def __init... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from tweepy.error import TweepError
from tweepy.utils import parse_datetime, parse_html_value, parse_a_href, \
parse_search_datetime, unescape_html
class ResultSet(list):
"""A list like object that holds results from a Twitter API... | Python |
"""
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import time
import threading
import os
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import hashlib
except ImportError:
# python 2.4
import md5 as hashlib
try:
import fcntl
except ImportError:
... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from tweepy.error import TweepError
class Cursor(object):
"""Pagination helper class"""
def __init__(self, method, *args, **kargs):
if hasattr(method, 'pagination_mode'):
if method.pagination_mode == 'cursor':
... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import httplib
from socket import timeout
from threading import Thread
from time import sleep
from tweepy.models import Status
from tweepy.api import API
from tweepy.error import TweepError
from tweepy.utils import import_simplejson, urlencod... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from tweepy.models import ModelFactory
from tweepy.utils import import_simplejson
from tweepy.error import TweepError
class Parser(object):
def parse(self, method, payload):
"""
Parse the response payload and return the r... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import httplib
import urllib
import time
import re
from tweepy.error import TweepError
from tweepy.utils import convert_to_utf8_str
from tweepy.models import Model
re_path_template = re.compile('{\w+}')
def bind_api(**config):
class AP... | Python |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
class TweepError(Exception):
"""Tweepy exception"""
def __init__(self, reason, response=None):
self.reason = unicode(reason)
self.response = response
def __str__(self):
return self.reason
| Python |
#!/usr/bin/python
import os, sys
_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, _PROJECT_DIR)
sys.path.insert(0, os.path.dirname(_PROJECT_DIR))
_PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME
from django.c... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.