Пример #1
0
def index():

	s = ""
	s = request.args.get('s', '')
	print "***Request.args = ", request.args.items()

	if s == SKX:
		search = SKX
		print "s SKX = ", search
	elif s == GSHOCK:
		search = GSHOCK
		print "s GSHOCK = ", search
	elif s == PROTREK:
		search = PROTREK
		print "s PROTREK= ", search
	elif s == PANERAI:
		search = PANERAI
		print "s PANERAI= ", search
	elif s == TRASER:
		search = TRASER
		print "s TRASER= ", search
	elif s != "":
		search = s.replace(" ", "")
	else:
		search = SKX
		print "s ELSE = ", search

	count = 33
	fotos = []

	api = InstagramAPI(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)

	max_id = 0
	api.tag(search)

	etiquetadas, next = api.tag_recent_media(count, max_id, search)

	for media in etiquetadas:
		print media.caption
		media_dicc = {}
		media_dicc['thumb_url'] = media.images['low_resolution'].url
		media_dicc['big_url'] = media.images['standard_resolution'].url
		fotos.append(media_dicc)

	return render_template("index.html", fotos=fotos)
Пример #2
0
client_id = raw_input("Enter Client Id: ")
client_secret = raw_input("Enter Client Secret: ")

ips = raw_input("Enter IP: ")
signature = hmac.new(client_secret, ips, sha256).hexdigest()
header = '|'.join([ips, signature])

j = 0
i = 0

timestr = time.strftime("%Y%m%d-%H%M%S")
tags = raw_input("Enter Tag that you want to Map: ")
api = InstagramAPI(access_token=access_token,
                   client_secret=client_secret,
                   client_ips=ips)
print api.tag(tags).media_count

lats, lons = [], []

while i < 4:
    m = api.tag_recent_media(count=40, tag_name=tags, max_tag=j)
    match = re.search(r'max_tag_id=(\d+)', m[1])
    j = match.group(1)
    for k in m[0]:
        try:
            a = str(k.location.point.latitude) + ',' + str(
                k.location.point.longitude)
            print a
            lats.append(k.location.point.latitude)
            lons.append(k.location.point.longitude)
        except Exception, e:
Пример #3
0
from instagram.client import InstagramAPI
import keys

api = InstagramAPI(access_token=keys.access_token,
                   client_secret=keys.client_secret)
media = api.tag("bitcoin")
Пример #4
0
from instagram.client import InstagramAPI
import random
import sys
import datetime

now = datetime.datetime.now()

access_token = "211585314.e1b377f.d45639f8eb394f2fa0ee3a8176311562"
api = InstagramAPI(access_token=access_token)

tagname=sys.argv[1]

taginfo=api.tag(tagname) 
current_count=taginfo.media_count

prefix="/home/was/.trace/"
lastname=prefix+str(tagname)+"_last.log"

try:
	fo = open(lastname, "r+")
	line = fo.read();
	fo.close()
except:
	line=0

last_count=int(line)

fo = open(lastname, "wb")
fo.write(str(current_count));
fo.close()
Пример #5
0
access_token = raw_input("Enter Access Token: ")
client_id = raw_input("Enter Client Id: ")
client_secret= raw_input("Enter Client Secret: ")

ips = raw_input("Enter IP: ")
signature = hmac.new(client_secret, ips, sha256).hexdigest()
header = '|'.join([ips, signature])

j = 0
i = 0

timestr = time.strftime("%Y%m%d-%H%M%S")
tags = raw_input("Enter Tag that you want to Map: ")
api = InstagramAPI(access_token = access_token,client_secret=client_secret,client_ips=ips)
print api.tag(tags).media_count

lats, lons = [], []

while i < 4:
	m = api.tag_recent_media(count=40,tag_name=tags,max_tag=j)
	match = re.search(r'max_tag_id=(\d+)',m[1])
	j=match.group(1)
	for k in m[0]:
		try:
			a = str(k.location.point.latitude) + ',' + str(k.location.point.longitude)
			print a
			lats.append(k.location.point.latitude)
			lons.append(k.location.point.longitude)
		except Exception,e:
			continue
Пример #6
0
from instagram.client import InstagramAPI
import urlparse

access_token = ''
clientid = ''
clientSecret = ''
url = ''

tag_name = '4000tricot'
max_tag_id = '0'

api = InstagramAPI(access_token=access_token)
user = api.user_search('')[0].id

tag_info = api.tag(tag_name)
count = tag_info.media_count
print count

f1 = file(tag_name + '.html', 'w')
h = '<html><table>'

i = 0

while True:

    recent_media, next_url = api.tag_recent_media(count, max_tag_id, tag_name)

    for media in recent_media:

        if i % 5 == 0:
            h = h + '<tr>'