Skip to main content

AdPushUp ads.txt management API.

Project description

This library provides adpushup API for handling ads.txt management.

Django:

  1. add it to installed apps:

    INSTALLED_APPS = (
        ...,
        'adpushup_adstxt',
        ...,
        )
    
  2. add your user_id and key to YOUR settings.py:

    ADPUSHUP_API_USER_ID = 'test@example.com'
    ADPUSHUP_API_KEY = '1234'
    
  3. OPTIONALLY add different WWW_DIR:

    ADPUSHUP_WWW_DIR = '/some/dir/to/put/ads.txt/in/it/'
    

    by default it is Djangos ROOT_DIR + '/www'

  4. ADD it to your urlconf:

    from adpushup_adstxt.django_views import handle
    
    urlpatterns += patterns(
        '',
        url(r'^adsTxtManagementApiByAdpushup.php', handle)),
    

Testing:

from adpushup_adstxt.utils import encode_uri_component
import time
import hmac
import hashlib
import requests

user_id = 'your user id'
key = 'your key'

req_time = int(time.time())
hash_params = "email={}&ts={}".format(
    encode_uri_component(user_id.encode("UTF-8")), req_time)
hash = hmac.new(key, hash_params, hashlib.sha256).hexdigest()

res = requests.post(
    'http://localhost:8000/adsTxtManagementApiByAdpushup.php',
    dict(
        data='test content',
        ts=req_time,
        hash=hash))

print res.status_code
print res.content

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adpushup-adstxt-0.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adpushup_adstxt-0.1.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file adpushup-adstxt-0.1.2.tar.gz.

File metadata

File hashes

Hashes for adpushup-adstxt-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7437575d4ad32b1c3c8efb33b974dbc222e7ebaa4645e17c0f0fd8a07ea9ba97
MD5 7ac6228abc4dd42eb587b1fb8eddb385
BLAKE2b-256 f6a790179933ab7969e26b050f58f525066c7ce8e00a9fc00ef3447e310aa9fa

See more details on using hashes here.

File details

Details for the file adpushup_adstxt-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for adpushup_adstxt-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c487434fd87f3ceb6bade363962ea4059d1e1ff4fb42706d8b8bee50f22472e
MD5 cd7089c1371e9c2d6d5cca3e80ae11f5
BLAKE2b-256 ec098007cb624eb62d110720deda58d08ec245dfd0cd9a1057127abe6c7741a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page