Ejemplo n.º 1
0
def index():
    trackingmore.set_api_key('fbbf2fc8-176b-4e23-aaec-8dac6e110150')
    print("lll")
    var1 = trackingmore.create_tracking_data('delhivery', '379211877610')
    print("")
    s = trackingmore.realtime_tracking(var1)
    print("lll")
    return render_template('test.html', **locals())
Ejemplo n.º 2
0
import sys
import apicorreios as correios
from datetime import datetime

import trackingmore
from pymongo import MongoClient

import apigeartrack as geartrack
import status

# https://www.trackingmore.com/api-index.html - Codigos de retorno da API
config = configparser.ConfigParser()
config.read('bot.conf')

key = config['TRACKINGMORE']['key']
trackingmore.set_api_key(key)

client = MongoClient()
db = client.rastreiobot


def set_carrier_db(code, carrier):
    db.rastreiobot.update_one({"code": code.upper()},
                              {"$set": {
                                  "carrier": carrier
                              }})


def set_correios_code(code, code_new):
    db.rastreiobot.update_one({"code": code.upper()},
                              {"$set": {
Ejemplo n.º 3
0
import trackingmore
import pprint

p = pprint.PrettyPrinter()
trackingmore.set_api_key('32de660c-b478-40f1-8c75-d5ada104be82')
var1 = trackingmore.create_tracking_data('delhivery', '379211877610')
s = trackingmore.realtime_tracking(var1)
p.pprint(s)
Ejemplo n.º 4
0
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
import requests
import trackingmore

trackingmore.set_api_key('1b17d38c-bbf4-4313-a71d-569b566bc08a')


def InputForm(request):
    return render(request, 'trackapp/InputForm.html')


def Result(request):
    name = request.GET.get('name')
    email = request.GET.get('emf')
    track_number1 = request.GET.get('trn')
    company = request.GET.get('company')

    for item in trackingmore.get_all_trackings()["data"]["items"]:
        if item["tracking_number"] == track_number1:
            trackingmore.delete_tracking_item(company, track_number1)

    td = trackingmore.create_tracking_data(company, track_number1)
    track_data = trackingmore.realtime_tracking(td)
    track_info1 = track_data["items"][0]["origin_info"]["trackinfo"]

    lis = []
    for item1 in track_info1:
        lis.append(item1)

    context = {