This file contains hidden or 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
| use GuzzleHttp\Client; | |
| use GuzzleHttp\HandlerStack; | |
| use GuzzleHttp\Middleware; | |
| $container = []; | |
| $history = Middleware::history($container); | |
| $stack = HandlerStack::create(); | |
| // Add the history middleware to the handler stack. | |
| $stack->push($history); |
This file contains hidden or 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 | |
| import os | |
| host = 'http://wyy.lybc.site' | |
| play_list_id = input("请输入歌单id: ") | |
| play_list_detail = requests.get(host + '/playlist/detail?id=' + play_list_id).json() | |
| print('获取歌单成功!歌单名称:{}, 共有歌曲 {} 首!'.format( | |
| play_list_detail['playlist']['name'], | |
| len(play_list_detail['playlist']['tracks']) |
This file contains hidden or 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 | |
| import math | |
| URL = 'https://shanghaicity.openservice.kankanews.com/public/bus/Getstop' | |
| COOKIE = u'aliyungf_tc=AQAAAJcMAkDFcQwArUwW0tGVUXzqI2Wq; acw_tc=2f624a3e15578382378173928e4fa7b33e16c44fd45349cd7c75966cd560c2; souid=wKgBHFzauYuOYl5c5gpmAg==; Hm_p1vt_6f69830ae7173059e935b61372431b35=eSgsNFzauZ2ZYgc+LP8GAg==; _ga=GA1.2.2037045191.1557838238; last_search_records=eyJpdiI6InZtOVwvRzcrZlloUDNiS1pYY1N2VnlRPT0iLCJ2YWx1ZSI6InhmWmY3NHJDc1FvUkhWWnBKODBoYTVPZGd3TUFEdVRVZ3FOa2ptRm42aVU9IiwibWFjIjoiNmI3N2Q0ZjQyYzA2NGY4YzBmOTZlZDVmMWFjMmUxM2I3MTFiNzM5MGVlNTBlOTg2NDM2NjUxNzBkYmZhZTJmNCJ9; XSRF-TOKEN=eyJpdiI6IkhMdEVUNDU3d1UxeVU3dHJPMzhJVVE9PSIsInZhbHVlIjoiMFRXZjRyVGZsRmhHdzlzY3hPTklFdkNCR1ArajY1QUNJMEVTSWtJOHh1TmF1UHAyTHpxSnFvN1hkN1YycGJ2bTdNcUJSd2oxZ1JlczVnXC85SE50d093PT0iLCJtYWMiOiIyY2M0M2I4ODA5ZDhkMWIwOGVjOGU1ZjA3NjliYmZjOTBlYjAwMWUzNWY2YzM5YWFlMjJlOWI4OGI3MTAxYTkwIn0%3D; _session=eyJpdiI6IldGZURaWGxwMnA2UG1pWHlXUXIxbFE9PSIsInZhbHVlIjoiclVQNnJja3E0b0dZcEZQNVVUNHJoXC9heThjbnl5MFZmUERZOG5BRUdQVndUV0lUZEk |
This file contains hidden or 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
| <div class="dropdown"> | |
| <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" | |
| aria-haspopup="true" aria-expanded="true"> | |
| 导入 | |
| <span class="caret"></span> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> | |
| <li><a href="{{ route('dictionaries.import-template') }}">下载导入模板</a></li> | |
| <li> | |
| <a data-toggle="modal" data-target="#myModal">导入</a> |
This file contains hidden or 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
| <div id="treeView"> | |
| <span class="label" *ngIf="treeNode.link"> | |
| <a [routerLink]="treeNode.link.url" [queryParams]="treeNode.link.queryParam ? treeNode.link.queryParam : {}" [innerHTML]="treeNode.name"></a> | |
| </span> | |
| <span class="label" *ngIf="! treeNode.link" [innerHTML]="treeNode.name"></span> | |
| <div class="branch"> | |
| <ng-container *ngTemplateOutlet="recursiveList; context: {$implicit: treeNode.childs}"></ng-container> | |
| </div> |
This file contains hidden or 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 sys | |
| import os | |
| import time | |
| import atexit | |
| import signal | |
| from logger import logger | |
| class Daemon: | |
| def __init__(self, pidfile): | |
| self.pidfile = pidfile # 进程控制文件 |
This file contains hidden or 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 random | |
| from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware | |
| class RotateUserAgentMiddleware(UserAgentMiddleware): | |
| def __init__(self, user_agent=''): | |
| self.user_agent = user_agent | |
| def process_request(self, request, spider): | |
| ua = random.choice(self.user_agent_list) |