Persiapkan diri untuk menghadapi perdagangan bebas

Dalam era keterbukaan Dan globalisa yang penuh dengan godaan, tantangan semakin kian berat yang mau tidak mau harus dihadapi dengan kesiapan yang penuh di antaranya; paling tidak dengan tidak gagal iptek, agar tidak jauh tertinggal oleh orang-orang yang sudah mempersiapkan diri untuk terjun di kancah persaingan global.

Jumat, 21 Juli 2017

Code cvd19

impor datetime
waktu impor
permintaan impor
import playsound #Anda mungkin perlu menginstal pygobject jika mendapatkan error tentang modul "gi" yang hilang.
playsound . playsound ( "ding.mp3" ) # Anda memerlukan file di sini yang berisik
sementara Benar :
coba :
r = permintaan . posting (
"https://ads-prd-gov-1-sp.test-for-coronavirus.service.gov.uk/testcentres/availabilityquery" ,
header = {
"otoritas" : "ads-prd-gov-1-sp.test-for-coronavirus.service.gov.uk" ,
"accept" : "application / json, text / plain, * / *" ,
"dnt" : "1" ,
"x-urlcode" : "*** DAPATKAN INI DI PERANGKAT PERANGKAT BROWSER DARI PERMINTAAN YANG DILAKUKAN OLEH SITUS ***" ,
"agen-pengguna" : "Mozilla / 5.0 (X11; Linux x86_64) AppleWebKit / 537.36 (KHTML, seperti Gecko) Chrome / 84.0.4147.135 Safari / 537.36" ,
"content-type" : "application / json" ,
"origin" : "https://test-for-coronavirus.service.gov.uk" ,
"sec-fetch-site" : "same-site" ,
"mode-ambil-detik" : "cors" ,
"sec-fetch-dest" : "kosong" ,
"referer" : "https://test-for-coronavirus.service.gov.uk/" ,
"accept-language" : "en-GB, en-US; q = 0.9, en; q = 0.8" ,
},
json = {
"topLevelTestCentreId" : "CVD19" ,
"kode pos" : "*** YOUR_POSTCODE ***" ,
"testCentreGroupIds" : [ "GR_RTS" , "GR_STS" , "GR_MTU" , "GR_LTS" ],
"startDate" : "** TANGGAL DALAM FORMAT INI: 2020-09-10T00: 00: 00 **" ,
"numberOfDays" : 5 ,
"appointmentTypeCode" : "ATCOM05" ,
"paging" : { "currentPage" : 1 , "pageSize" : 3 },
},
). json ()
print ( "Time:" , datetime . datetime . now ())
jika len ( r [ "testCentres" ]) == 0 :
print ( "Tidak ada!" )
untuk c di r [ "testCentres" ]:
cetak (
c [ "testCentre" ] [ "displayName" ],
c [ "geolocation" ] [ "jarak" ],
c [ "ketersediaan" ] [ "tersediaSlots" ],
)
jika float ( c [ "geolocation" ] [ "distance" ]) < 50 :
untuk saya dalam jangkauan ( 20 ):
playsound . playsound ( "ding.mp3" )
kecuali :
playsound . playsound ( "ding.mp3" )
waktu . tidur ( 60 )
# Contoh permintaan dan tanggapan dari alat dev chrome:
# curl 'https://ads-prd-gov-1-sp.test-for-coronavirus.service.gov.uk/testcentres/availabilityquery' \
# -H 'otoritas: ads-prd-gov-1-sp.test-for-coronavirus.service.gov.uk' \
# -H 'terima: application / json, text / plain, * / *' \
# -H 'dnt: 1' \
# -H 'x-urlcode: YOUR_CODE_HERE' \
# -H 'agen pengguna: Mozilla / 5.0 (X11; Linux x86_64) AppleWebKit / 537.36 (KHTML, seperti Gecko) Chrome / 84.0.4147.135 Safari / 537.36' \
# -H 'tipe konten: application / json' \
# -H 'asal: https://test-for-coronavirus.service.gov.uk' \
# -H 'situs-ambil-detik: situs-sama' \
# -H 'mode-pengambilan-detik: cors' \
# -H 'sec-fetch-dest: kosong' \
# -H 'referer: https://test-for-coronavirus.service.gov.uk/' \
# -H 'accept-language: en-GB, en-US; q = 0.9, en; q = 0.8' \
# --data-binary '{"topLevelTestCentreId": "CVD19", "postcode": "YOUR_POSTCODE", "testCentreGroupIds": ["GR_RTS", "GR_STS", "GR_MTU"], "startDate": "2020-09 -10T00: 00: 00 "," numberOfDays ": 5," appointmentTypeCode ":" ATCOM05 "," paging ": {" currentPage ": 1," pageSize ": 3}} '\
# --kompresi
# {
# "testCentres": [
# {
# "ketersediaan": {
# "tersediaSlots": 3,
# "slotsAvailableOn": ["2020-09-11T00: 00: 00"],
#},
# "geolocation": {"distance": 113.036529084286},
# "testCentre": {
# "testCentreId": "LRC",
# "displayName": "Central Chester - Situs berjalan-jalan",
# "alamat": {
# "addressLine1": "Little Roodee Car Park",
# "kota": "Chester",
# "kode pos": "CH1 1SL",
#},
# "aktif": benar,
# "testCentreGroupId": "GR_LTS",
#},
#},
# {
# "ketersediaan": {
# "tersediaSlots": 7,
# "slotsAvailableOn": ["2020-09-11T00: 00: 00"],
#},
# "geolocation": {"distance": 130.744753751102},
# "testCentre": {
# "testCentreId": "KNH",
# "displayName": "Kirklees Ravensthorpe - Telusuri situs",
# "alamat": {
# "addressLine1": "Tempat Parkir Perumahan Kirklees Neighborhood, Queen Street",
# "kota": "Ravensthorpe",
# "kode pos": "WF13 3BT",
#},
# "aktif": benar,
# "testCentreGroupId": "GR_LTS",
#},
#},
# {
# "ketersediaan": {
# "tersediaSlots": 1,
# "slotsAvailableOn": ["2020-09-11T00: 00: 00"],
#},
# "geolocation": {"distance": 134.594445459396},
# "testCentre": {
# "testCentreId": "CAL",
# "displayName": "Halifax Calderdale - Walk through site",
# "alamat": {
# "addressLine1": "Overflow Car Park, ASDA Halifax Superstore, Thrum Hall Lane",
# "kota": "Halifax",
# "kode pos": "HX1 4PG",
#},
# "aktif": benar,
# "testCentreGroupId": "GR_LTS",
#},
#},
#],
# "flagInvalidGeoLocation": salah,
# "customerCode": "XXXXXXX",
#}

StatisticTotal Tayangan Laman