This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import requests | |
import json | |
def get_json(): | |
url = "https://www.ozon.ru/api/composer-api.bx/page/json/v2" \ | |
"?url=/product/avtomaticheskaya-kofemashina-inhouse-rozhkovaya-coffee-arte-icm1507-seryy-397529235/" | |
response = requests.get(url=url) | |
with open('ozon_1.json', 'w', encoding='utf-8') as file: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
from datetime import datetime | |
headers = {"x-fsign": "SW9D1eZo"} | |
def main(): | |
feed = 'f_1_-1_3_ru_5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
response = requests.get('http://jsonip.com') | |
ip = response.json()['ip'] | |
print('Your public IP is:', ip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from pathlib import Path | |
import requests | |
from transliterate import slugify | |
def download_image(image_url, image_name): | |
# получаем расширение файла изображения из url | |
# и добавлем его к имени изображения | |
image_name += Path(image_url).suffix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
from environs import Env | |
@dataclass | |
class Bots: | |
bot_token: str | |
admin_id: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"_id":"avito","startUrl":["https://www.avito.ru/krasnodar/kvartiry/sdam/na_dlitelnyy_srok/2-komnatnye-ASgBAQICAkSSA8gQ8AeQUgFAzAgUkFk?cd=1&p=[1-6]"],"selectors":[{"delay":0,"id":"adv","multiple":true,"parentSelectors":["_root"],"selector":"div.iva-item-list-H_dpX","type":"SelectorElement"},{"delay":0,"id":"link","multiple":false,"parentSelectors":["adv"],"selector":"a.link-link-MbQDP[itemprop='url']","type":"SelectorLink"},{"delay":0,"id":"price","multiple":false,"parentSelectors":["adv"],"regex":"","selector":"span.price-text-E1Y7h","type":"SelectorText"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
from typing import Dict, List, Tuple | |
def insert(database: str, table: str, column_values: Dict): | |
with sqlite3.connect(database) as conn: | |
cursor = conn.cursor() | |
columns = ", ".join(column_values.keys()) | |
values = [tuple(column_values.values())] | |
placeholders = ", ".join("?" * len(column_values.keys())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import csv | |
import time | |
import json | |
import requests | |
headers = { | |
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sshtunnel import SSHTunnelForwarder | |
import pymysql | |
host = 'test.beget.tech' | |
login = 'test' | |
password = 'test' | |
user_db = 'test_db' | |
password_db = 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_head', 'sdek_script' ); | |
function sdek_script() { | |
?> | |
<script id="ISDEKscript" type="text/javascript" src="https://widget.cdek.ru/widget/widjet.js" charset="utf-8"></script> | |
<?php | |
} |
NewerOlder