import couchdb
import sys
import urllib2

from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import json

# encoding:utf-8
##########API CREDENTIALS ############   Poner sus credenciales del API de dev de Twitter
ckey = "ZYF88A12e7LeuXJTAM3yEKNAf"
csecret = "MKAXjIjXVWOzpA7PPFdi69iWzSOpRPHSlx9jdlO1IqddFjmZd5"
atoken = "121881131-Xyc6cGon0YSCEgKtaqXxiPIi6C1HYxd2sQOFXkoV"
asecret = "kmDZXdTlwPQKjsJ7HjIqFVgJgfJlTUJlSZdPwsCTLaVkC"

URL = 'localhost'
db_name = 'new_database'
'''========couchdb'=========='''
server = couchdb.Server('http://' + URL + ':5984/')

try:
    print db_name
    db = server[db_name]
    print "exito"

except:
    sys.stderr.write("Error: DB not found. Closing...\n")
    sys.exit()

'''===============LOCATIONS=============='''
url = 'http://localhost:5984/new_database/_design/1/_view/esteban1'
req = urllib2.Request(url)
f = urllib2.urlopen(req)
sys.stdout=open("tweetsUIO.txt","w")
for x in f:
    print(x)
sys.stdout.close()
f.close()
@@ -1,504 +1,583 @@
-import couchdb%0Aimport sys%0Aimport urllib2%0A%0Afrom tweepy import Stream%0Afrom tweepy import OAuthHandler%0Afrom tweepy.streaming import StreamListener%0Aimport json%0A%0A# encoding:utf-8%0A##########API CREDENTIALS ############   Poner sus credenciales del API de dev de Twitter%0Ackey = %22ZYF88A12e7LeuXJTAM3yEKNAf%22%0Acsecret = %22MKAXjIjXVWOzpA7PPFdi69iWzSOpRPHSlx9jdlO1IqddFjmZd5%22%0Aatoken = %22121881131-Xyc6cGon0YSCEgKtaqXxiPIi6C1HYxd2sQOFXkoV%22%0Aasecret = %22kmDZXdTlwPQKjsJ7HjIqFVgJgfJlTUJlSZdPwsCTLaVkC%22%0A%0AURL = 'localhost'
+#C%C3%B3digo escrito en Python semejante al archivo harvester_uio.py que permite extraer %0A#todos los tweets que conforman una vista e imprimirlos a un archivo txt%0A#Colocar las credenciales de desarrollador de Twitter%0A#Colocar el nombre correspondiente a la base de datos%0A%0Aimport couchdb%0Aimport sys%0Aimport urllib2%0A%0Afrom tweepy import Stream%0Afrom tweepy import OAuthHandler%0Afrom tweepy.streaming import StreamListener%0Aimport json%0A%0A# encoding:utf-8%0A##########API CREDENTIALS ############%0Ackey = %22%22%0Acsecret = %22%22%0Aatoken = %22%22%0Aasecret = %22%22%0A%0AURL = 'localhost'%0A#Colocar nombre de base de datos
 %0Adb_
@@ -837,53 +837,8 @@
 ()%0A%0A
-'''===============LOCATIONS=============='''%0A
 url 
@@ -1035,16 +1035,17 @@
 lose()%0Af.close()
+%0A

Update printInFile.py