From e4942fdab9a43712d56b38dbdb8421d38d7743df Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 31 Mar 2020 22:23:38 +0200 Subject: ebknotify: add feed --- ebknotify/example.py | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 ebknotify/example.py (limited to 'ebknotify/example.py') diff --git a/ebknotify/example.py b/ebknotify/example.py new file mode 100644 index 0000000..bbddc19 --- /dev/null +++ b/ebknotify/example.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +ebk-client - eBay Kleinanzeigen/Classifieds API client in Python +Copyright (c) 2016 tjado + +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, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + +Author: tjado +""" + +from pprint import pprint +import dateutil.parser +from datetime import datetime +from dateutil.tz import tzlocal +import sys +import json +from ebk_client import EbkClient +u = "ebay-kleinanzeigen.de@syntax-fehler.de" +api = EbkClient('android', 'TaR60pEttY', u , 'se.J {}".format(id, age_in_h, title_unescaped) ) + +#categories = api.get_categories() +#print(nice(categories)) +#print('Subcategories of cat 80:\n\r{}'.format(nice(categories))) +# +#locations = api.get_location_by_name('70378') +#print('Location by german postcode 70378:\n\r{}'.format(nice(locations))) + +# locations = api.get_location_by_coordinates(53.553155, 10.006151) +# print('Location Latitude/Longitude:\n\r{}'.format(pprint.PrettyPrinter(indent=4).pformat(locations))) + +# category_attributes = api.get_category_attributes(88) +# print('Category Attributes for cat 88:\n\r{}'.format(pprint.PrettyPrinter(indent=4).pformat(category_attributes))) -- cgit v1.2.3