Commit 7f7d3d81 authored by litaolemo's avatar litaolemo

update

parent 20e66c62
# -*- coding:UTF-8 -*-
# @Time : 2020/8/12 9:41
# @File : temp_write_file.py
# @email : litao@igengmei.com
# @author : litao
import pymysql
from elasticsearch import Elasticsearch
id_list = [
"zhihu_270099331_962256928",
"zhihu_404045674_1328470234",
"zhihu_353026514_1019359974",
"weibo_2309404521627739357239",
"weibo_2309404442294991323517",
"zhihu_367512264_1030527094",
"zhihu_351838166_1096749670",
"zhihu_321679512_1369535927",
"weibo_2309351001864384187909051818",
"zhihu_33797069_1193514958",
"zhihu_31611948_452375608",
"weibo_2309404213147534807743",
"zhihu_368157044_1083185254",
"zhihu_40301806_211329640",
"zhihu_364385168_966590802",
"zhihu_352461801_1203509364",
"zhihu_33261826_63922271",
"zhihu_331940220_730583638",
"zhihu_49391478_245275673",
"zhihu_345067741_884270241",
"weibo_2309404263925460894977",
"zhihu_20413215_532597047",
"weibo_2309404497612488179840",
"weibo_2309404520917672788542",
"weibo_2309404522702747861694",
"zhihu_325099876_781214073",
"zhihu_334915698_1160355104",
"zhihu_58660444_1109357837",
"zhihu_345086669_1253393290",
"zhihu_68760437_388531805",
"zhihu_58660444_867069436",
"zhihu_388141109_1288455104",
"zhihu_37357338_1246151093",
"zhihu_405680054_1326580647",
"zhihu_65123027_648018097",
"zhihu_299074164_1381482301",
"zhihu_68582467_264996971",
"zhihu_20776172_1071832230",
"zhihu_343179934_848798332",
"zhihu_317759131_695545717",
"zhihu_290501081_1332386072",
"zhihu_405642025_1325698494",
"zhihu_31236993_1122191316",
"zhihu_23035602_686516214",
"zhihu_319804341_1251352604",
"zhihu_29912502_375896118",
"zhihu_296927587_796611096",
"weibo_2309404183006125390600",
"zhihu_317514321_1249246514",
"zhihu_38630534_77337489",
"zhihu_22228298_688879869",
"zhihu_24886476_946845894",
"zhihu_42054226_742882956",
"zhihu_324064493_977284372",
"zhihu_320691388_854822786",
"weibo_2313501000014283385051771509",
"zhihu_318360813_746268426",
"zhihu_63185064_1287976696",
"zhihu_34803578_841733851",
"zhihu_48586676_112193410",
"zhihu_264445637_1362332998",
"zhihu_340980643_1335742289",
"zhihu_394269355_1218010969",
"zhihu_56661064_157705612",
"zhihu_314728664_1105205022",
"zhihu_355738509_1352243349",
"zhihu_343224380_808580004",
"zhihu_24282309_518177904",
"weibo_2310664045727285260885",
"weibo_2309404438559732924548",
"zhihu_308838405_655280455",
"zhihu_301231510_1074783354",
"zhihu_359391189_946263667",
"weibo_2309404501155773284480",
"zhihu_30097964_751308454",
"zhihu_281050881_946491937",
"zhihu_264476156_856655098",
"zhihu_29240305_684271105",
"zhihu_36804435_629224920",
"weibo_2309404245039265012468",
"zhihu_291739864_654064293",
"zhihu_325099876_1152483177",
"zhihu_41854964_383422291",
"weibo_2309404510251914231942",
"zhihu_48234036_1081435027",
"zhihu_344729359_903784698",
"zhihu_320691388_1344312549",
"weibo_2309404509518628257839",
"zhihu_20116080_202093362",
"zhihu_352461801_881533981",
"zhihu_357643331_909089595",
"zhihu_351476976_1220019174",
"zhihu_334150326_744962158",
"zhihu_377576182_1088169414",
"zhihu_320096542_794382246",
"zhihu_401003950_1279336588",
"weibo_2309404265665044296242",
"weibo_2313501000014392825394429996",
"zhihu_27932301_930312753",
"zhihu_324257590_1206853862",
"zhihu_299744790_517286557",
"zhihu_28569572_418382308",
"zhihu_321199192_999707172",
"zhihu_351838166_1283919773",
"zhihu_410372888_1371153450",
"zhihu_26613082_257829318",
"zhihu_31849926_773475745",
"zhihu_320096542_838475060",
"zhihu_305330750_611534377",
"zhihu_317869815_1123737936",
"zhihu_304070537_542174608",
"zhihu_316752339_629455181",
"zhihu_270093614_1256492447",
"zhihu_322880215_674677703",
"zhihu_59364414_1082356632",
"zhihu_60561625_178395250",
"zhihu_27014301_812858772",
"zhihu_311297911_594670379",
"zhihu_385771669_1137071622",
"zhihu_266177667_307639073",
"zhihu_28351471_90655804",
"zhihu_28932484_42843774",
"zhihu_312641286_1170144442",
"zhihu_19638296_1117077657",
"zhihu_413386873_1400047409",
"zhihu_344894752_820064027",
"zhihu_34733760_70787178",
"zhihu_292541102_635570533",
"weibo_2309404525077868707869",
"zhihu_58660444_1254063211",
"zhihu_269743577_1289841630",
"zhihu_263860345_602246825",
"zhihu_27430540_965863570",
"zhihu_279943904_987034732",
"zhihu_39388745_471276268",
"zhihu_58660444_1107296465",
"zhihu_393795608_1214193713",
"zhihu_340895286_1020474205",
"zhihu_35626325_478898247",
"zhihu_280630505_427588324",
"zhihu_383626148_1144346410",
"zhihu_308391227_770976011",
"weibo_2313501000014252298523115016",
"zhihu_53168362_874531471",
"zhihu_24521791_295661501",
"zhihu_382944745_1363951884",
"weibo_2309404191458251907456",
"zhihu_382597049_1175006935",
"weibo_2309404516134811468166",
"zhihu_355387649_922064905",
"zhihu_327236258_714198681",
"zhihu_280288583_557406118",
"zhihu_22390958_821840922",
"zhihu_66080644_238722852",
"weibo_2309404524479190532279",
"zhihu_281050881_473821048",
"zhihu_264671171_726085212",
"weibo_2309614163285942462046",
"zhihu_296927587_790664613",
"zhihu_66390314_1204035120",
"zhihu_58941705_699072784",
"zhihu_392591592_1223719080",
"zhihu_29261843_112547816",
"zhihu_317514321_1273199759",
"weibo_2313501000014192624541074975",
"zhihu_55677925_1391516280",
"zhihu_395655466_1335737398",
"zhihu_31740966_1293412035",
"zhihu_364751575_968126951",
"zhihu_398975462_1309569043",
"zhihu_268838275_342841580",
"zhihu_319908448_715426234",
"zhihu_50167815_1330456355",
"zhihu_267307933_1238144387",
"weibo_2309404510366729109962",
"zhihu_355738509_1293328943",
"zhihu_28448892_1219971748",
"zhihu_265108036_1089822146",
"weibo_2309404213124982031164",
"zhihu_58660444_901019887",
"zhihu_27865278_528788964",
"zhihu_310727503_743002414",
"zhihu_304781490_770628343",
"zhihu_378008246_1069085874",
"zhihu_380249499_1264003567",
"zhihu_406114480_1330511680",
"weibo_2309404424039283163150",
"zhihu_320691388_1036842129",
"zhihu_26674026_974997388",
"zhihu_333848832_815462742",
"zhihu_54442766_584835306",
"weibo_2309404531617161937107",
"zhihu_380249499_1324217791",
"zhihu_333919787_888738977",
"zhihu_23972203_143792803",
"zhihu_334818307_749751810",
"zhihu_333942303_742115647",
"zhihu_66515446_306235262",
"zhihu_359160961_961261581",
"zhihu_349170116_859660994",
"weibo_2309404327425499627048",
"weibo_2309404524795147452420",
"zhihu_296384939_631311020",
"zhihu_42964240_927427430",
"zhihu_49735282_1101958350",
"weibo_2309404325803981696053",
"zhihu_65087946_1072233022",
"zhihu_296656270_632088653",
"zhihu_58660444_1315591136",
"zhihu_28698056_490803941",
"weibo_2309404515295183110301",
"zhihu_58073201_1338909334",
"zhihu_21686953_1326735275",
"weibo_2310664179474135521387",
"zhihu_53994295_370316776",
"zhihu_34892616_1102034093",
"zhihu_317514321_961203853",
"zhihu_395345047_1258635445",
"weibo_2309404404461408747590",
"zhihu_270546703_1157885376",
"zhihu_24213021_402629874",
"zhihu_348863732_850840089",
"zhihu_328854780_997918709",
"zhihu_373413056_1058246351",
"zhihu_277361699_425423375",
"zhihu_375253270_1053660355",
"zhihu_336145262_757858665",
"zhihu_285007789_1361850919",
"zhihu_30992747_272417890",
"zhihu_31201514_762863336",
"zhihu_21898759_83946793",
"zhihu_20376454_1236980339",
"weibo_2309404463542664298712",
"zhihu_374744706_1219354289",
"zhihu_49240267_766652690",
"zhihu_392591592_1222656102",
"zhihu_379725816_1145886608",
"weibo_2309404277939448489736",
"zhihu_394328030_1219420522",
"weibo_2310664201449306330631",
"zhihu_58660444_914217009",
"zhihu_400261071_1288207670",
"zhihu_326155561_709636132",
"zhihu_315615540_813558995",
"zhihu_288386115_682588432",
"zhihu_375378761_1051395483",
"zhihu_27854025_1345938738",
"zhihu_67678691_1330132483",
"zhihu_328457531_1021716072",
"zhihu_338254765_1017540607",
"zhihu_26092345_595868215",
"zhihu_348566387_1058053628",
"zhihu_29593324_222375864",
"zhihu_407697158_1346827101",
"zhihu_320691388_829036909",
"zhihu_40606741_977414933",
"zhihu_50571271_1288180778",
"weibo_2309404519259798634798",
"zhihu_26011041_1383717560",
"zhihu_394994502_1315082396",
"weibo_2309404530575217393671",
"zhihu_319371540_723052281",
"zhihu_388147246_1341995678",
"weibo_2309404530355662356692",
"zhihu_40778139_88188735",
"zhihu_30288235_715334789",
"zhihu_319626645_1211511202",
"weibo_2310474329916098302391",
"zhihu_34961785_1394231576",
"weibo_2309404128716832780301",
"zhihu_374670672_1166943426",
"zhihu_358528281_916325448",
"zhihu_39284255_207614242",
"zhihu_325099876_1279578231",
"zhihu_273944504_1008650712",
"zhihu_348566387_1050139774",
"weibo_2309404500478850367580",
"weibo_2309404213145341139412",
"zhihu_322786907_671427263",
"zhihu_283857656_480262861",
"zhihu_29752796_665692658",
"weibo_2309404534250316890299",
"zhihu_295606540_503292151",
"zhihu_400647367_1283041058",
"zhihu_318558556_758205881",
"zhihu_264525515_1211470145",
"zhihu_49442555_156867524",
"weibo_2309404515383523541124",
"zhihu_33731310_661781846",
"zhihu_20871631_770240853",
"zhihu_301391577_806532506",
"zhihu_29672135_1289971020",
"zhihu_305330750_684310826",
"zhihu_22294440_1312753428",
"zhihu_387423440_1385446584",
"zhihu_293367835_485323689",
"zhihu_382547336_1200389582",
"zhihu_289032339_463873758",
"zhihu_300681626_971732017",
"zhihu_327996803_1237500718",
"zhihu_31947726_1311121301",
"zhihu_30146575_192924766",
"zhihu_404071764_1310977664",
"zhihu_266806255_1017823422",
"weibo_2309404508107572117693",
"zhihu_407205599_1341956450",
"zhihu_330993040_728491672",
"zhihu_31624953_628003614",
"zhihu_391974195_1196583568",
"zhihu_35297594_790583228",
"zhihu_45766337_943844850",
"zhihu_351838166_1258902017",
"weibo_2309404480270647558412",
"zhihu_66775255_452056189",
"zhihu_305330750_758094349",
"zhihu_333726842_742435864",
"zhihu_58562321_1056703321",
"zhihu_320691388_730138229",
"zhihu_361475007_942011799",
"zhihu_62880159_1194196151",
"zhihu_63984175_938366361",
"zhihu_270104324_1314670603",
"zhihu_38737064_1204137824",
"zhihu_63185064_735042661",
"zhihu_283793220_761097188",
"zhihu_28733175_259177383",
"weibo_2309404213127838326024",
"zhihu_326694556_736124520",
"zhihu_43504663_410138943",
"zhihu_365214053_974098928",
"zhihu_274221381_693950546",
"zhihu_357609230_908899058",
"zhihu_20808679_160145806",
"zhihu_44594553_700212701",
"zhihu_33731310_1220215853",
"zhihu_278776892_545086686",
"zhihu_20442971_15147832",
"zhihu_33112726_964936537",
"zhihu_395993510_1282830727",
"zhihu_394841032_1289548724",
"zhihu_340048839_1283362882",
"zhihu_386441700_1248316048",
"zhihu_268230026_807224507",
"zhihu_339964841_791890698",
"zhihu_322565363_671913094",
"zhihu_351702643_864536352",
"zhihu_308991000_1309438028",
"weibo_2309404437494060941556",
"zhihu_281227069_801761412",
"zhihu_30913781_236407896",
"zhihu_280106372_411529228",
"zhihu_22381415_79308754",
"zhihu_270546703_1101258219",
"zhihu_21428646_964908942",
"zhihu_310055709_616836196",
"zhihu_381916622_1350539236",
"zhihu_296927587_529912368",
"zhihu_282620628_964901712",
"zhihu_400720842_1289138307",
"zhihu_313369462_606316513",
"zhihu_361172953_1214425811",
"weibo_2309404534874433257700",
"zhihu_61158028_1103986603",
"zhihu_21583000_483886493",
"zhihu_320459954_715884091",
"zhihu_264723161_916543183",
"weibo_2309404523788288262146",
"zhihu_314715242_1259594194",
"zhihu_355442999_895280371",
"zhihu_405308193_1322096196",
"zhihu_34892616_896229980",
"zhihu_29249087_124898419",
"zhihu_270102346_1315080722",
"zhihu_31457626_392912213",
"weibo_2309404272519518535903",
"zhihu_280558706_511962890",
"zhihu_266556264_1062537230",
"zhihu_268750570_1360881923",
"zhihu_27809509_340288295",
"zhihu_310105493_868101433",
"zhihu_57466993_374272502",
"zhihu_338167435_1234574536",
"zhihu_47014014_353562550",
"zhihu_344754554_816319342",
"zhihu_21317678_114701135",
"weibo_2309404518566358548694",
"zhihu_20050062_1115245404",
"zhihu_20756458_1300297259",
"zhihu_308391227_676448388",
"zhihu_40604182_605016979",
"zhihu_403587179_1307387378",
"zhihu_408341059_1353726597",
"weibo_2309404501027918315579",
"zhihu_412634378_1395625825",
"zhihu_340847881_975410254",
"zhihu_387669358_1154170247",
"zhihu_333816595_1307151605",
"weibo_2309404520747744756119",
"weibo_2309404192133862011816",
"zhihu_49368842_223836651",
"zhihu_405523443_1324502882",
"zhihu_353961723_1311465913",
"zhihu_319425534_892596464",
"zhihu_34878348_802891260",
"zhihu_26674026_1071841560",
"zhihu_30345243_175502434",
"zhihu_306470349_1302749593",
"zhihu_264476156_746034817",
"zhihu_313129288_866118585",
"weibo_2309403971005767928729",
"zhihu_20309939_19453493",
"zhihu_344244827_1026214367",
"zhihu_300318574_1395413570",
"zhihu_42138802_210120423",
"zhihu_351332222_861774322",
"zhihu_65087946_1120339764",
"zhihu_37821324_386255845",
"zhihu_34546303_514554607",
"zhihu_317708308_633982350",
"zhihu_62982296_759335510",
"zhihu_401032296_1284510353",
"zhihu_295171071_870433267",
"weibo_2309404260231310927932",
"zhihu_277475706_804842621",
"zhihu_405633540_1343505424",
"zhihu_50144634_148336803",
"zhihu_28503220_230000625",
"weibo_2309404279474194626412",
"zhihu_63237722_829915505",
"zhihu_350002592_855158261",
"zhihu_308769796_594435444",
"zhihu_22918070_189879564",
"zhihu_323452433_696819683",
"weibo_2309404400915850330407",
"zhihu_26241613_149329368",
"zhihu_65953665_1072355673",
"zhihu_27470291_376043638",
"zhihu_402084479_1366114370",
"zhihu_305879457_921504300",
"zhihu_386441700_1342038393",
"zhihu_400702502_1292057161",
"zhihu_398489789_1256130788",
"weibo_2310474383491956600264",
"zhihu_50076990_674915278",
"zhihu_57366229_1218463687",
"weibo_2309404303771277609161",
"zhihu_39315904_1381197460",
"zhihu_316492347_939081079",
"zhihu_328893702_720444325",
"zhihu_50076990_771917952",
"zhihu_334915698_942241556",
"zhihu_19589353_1322625442",
"zhihu_385478532_1132103352",
"zhihu_296721599_506591519",
"zhihu_59071793_1266019168",
"weibo_2309404516918349398090",
"weibo_2309404532412469084235",
"zhihu_27310315_789721336",
"zhihu_301608212_557114702",
"weibo_2309404519102508040804",
"zhihu_339906147_794544958",
"zhihu_282657655_490941293",
"zhihu_395583495_1240866615",
"zhihu_35529840_749796461",
"zhihu_370406183_1004389192",
"zhihu_33731310_338286420",
"zhihu_387423440_1357749203",
"zhihu_53913339_1057544534",
"zhihu_340653982_795474780",
"zhihu_33797069_964409032",
"zhihu_34892616_405215435",
"zhihu_282620628_1007358648",
"zhihu_37777781_391446188",
"zhihu_40519288_241044483",
"zhihu_288080623_1375869560",
"zhihu_297662538_800955513",
"zhihu_360545404_932861906",
"zhihu_340178764_857636047",
"zhihu_26931337_549952719",
"zhihu_309439041_815734009",
"weibo_2309404492887290151168",
"zhihu_359048207_920956037",
"zhihu_406094080_1330237171",
"zhihu_406462481_1337857535",
"zhihu_340304301_901987081",
"zhihu_401031428_1313105529",
"zhihu_26865014_296188607",
"weibo_2309404505866400301254",
"zhihu_353262129_876435560",
"zhihu_36205160_370171693",
"zhihu_303097153_535744015",
"zhihu_369793767_1004768832",
"zhihu_342266451_803217614",
"weibo_2309404052600096986358",
"zhihu_50889676_146694825",
"zhihu_338071882_1344444369",
"zhihu_294503536_777217816",
"zhihu_320287107_777645619",
"zhihu_287736873_1171961894",
"zhihu_21112956_153291054",
"zhihu_345623836_1165386896",
"zhihu_38436946_859309660",
"zhihu_60487018_176775012",
"zhihu_58562321_672659160",
"zhihu_58442444_538680775",
"zhihu_269986710_1182961331",
"zhihu_300059176_1341530599",
"zhihu_337211885_845679558",
"zhihu_285927312_692660636",
"zhihu_30143718_704152135",
"zhihu_330272085_1172188995",
"zhihu_58660444_865319193",
"weibo_2309404521939887849660",
"zhihu_353729092_879052119",
"zhihu_296490520_961243577",
"zhihu_270546703_1310550531",
"zhihu_317514321_1202052517",
"zhihu_411627736_1391302388",
"zhihu_400887631_1294026182",
"weibo_2309404446924219482246",
"zhihu_400971272_1376501934",
"zhihu_36123823_166360021",
"zhihu_274221381_1284176809",
"weibo_2313501000014202982144127438",
"zhihu_306522586_1115635181",
"zhihu_53200940_981370763",
"zhihu_28543389_891477914",
"zhihu_47089002_1052959887",
"zhihu_268395554_1342640175",
"zhihu_27932301_1001627161",
"zhihu_294981637_503577889",
"zhihu_335050784_1386602820",
"zhihu_352143972_868541061",
"zhihu_54128409_539309130",
"zhihu_338631482_792193140",
"zhihu_270104252_1264321911",
"zhihu_49230533_526047049",
"zhihu_29662228_1013995343",
"weibo_2309351002864324085034255002",
"zhihu_336692514_783520190",
"zhihu_407027627_1383704732",
"zhihu_53934389_166206299",
"zhihu_397292709_1245562856",
"zhihu_317274574_648709251",
"zhihu_282620628_925989329",
]
def send_email(query_id_dict):
try:
if query_id_dict:
for search_keyword in query_id_dict:
title_str = "关键词%s帖子内容审核" % search_keyword
body_str = """
问好:
新的query:{search_keyword} 抓取内容需要审核,帖子号为\n
""".format(search_keyword=search_keyword, )
for tractate_id in query_id_dict[search_keyword]:
body_str += str(tractate_id) + ", "
print("line25", str(tractate_id))
send_file_email("", "",
email_group=["<liulingling@igengmei.com>", "<liujinhuan@igengmei.com>",
"‎<hongxu@igengmei.com>", "‎<yangjiayue@igengmei.com>",
"‎<zhangweiwei@igengmei.com>", "‎<liuyiting@igengmei.com>"],
cc_group=["‎<duanyingrong@igengmei.com>", "‎<litao@igengmei.com>"],
email_msg_body_str=body_str, title_str=title_str)
print("send to mysql")
except Exception as e:
print("send email error %s" % e)
from maintenance.func_send_email_with_file import send_file_email
es_framework = Elasticsearch(hosts='172.16.32.37', port=9200)
conn = pymysql.connect(host='172.16.30.138', port=3306, user='mimas', passwd='GJL3UJe1Ck9ggL6aKnZCq4cRvM',
db='mimas_prod', charset='utf8mb4')
cur = conn.cursor()
query_id_dict = {}
for _id in id_list:
res = es_framework.get_source('crawler-data-raw',_id)
search_word = res["search_word"]
sql = """
select id from api_tractate where platform_id = '{id}'
""".format(id=_id)
cur.execute(sql)
data = cur.fetchall()
sql_id = data[0][0]
if not query_id_dict.get(search_word):
query_id_dict[search_word] = {}
query_id_dict[search_word][sql_id] = 1
send_email(query_id_dict)
cur.close()
conn.close()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment