Editorial Workflows

city_pm

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: This workflow has no description.

Shared by: 获取成都空气质量报告

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import requests
from bs4 import BeautifulSoup
res=requests.get('http://www.pm25.com/chengdu.html')
soup = BeautifulSoup(res.text)
city = soup.find(class_ = 'bi_loaction_city')   # 城市名称
aqi = soup.find("a",{"class","bi_aqiarea_num"})  # AQI指数
quality = soup.select(".bi_aqiarea_right span")  # 空气质量等级
result = soup.find("div",class_ ='bi_aqiarea_bottom')   # 空气质量描述

action_out = city.text + 'AQI指数:' + aqi.text + '\n空气质量:' + quality[0].text + result.text

workflow.set_output(action_out)
Repeat… ?
Repeat with
  • Every Line
  • Every Match of Regular Expression:
[\u4e00-\u9fa5|A-Z].*
Match Group
0 (entire match)
Reverse
OFF
…End Repeat
Console Output ?
Text
Input
Create Document ?
Filename
Untitled.txt
Content
Input
Open in Editor
ON