!function(){var city = {"SHA":"上海虹桥","PVG":"上海浦东","YIW":"义乌","JUZ":"衢州","HSN":"舟山(普陀山)","WNZ":"温州","NGB":"宁波","LNJ":"临沧","ZAT":"昭通","SYM":"思茅","LUM":"芒市","BSD":"保山","KMG":"昆明","JHG":"西双版纳","DLU":"大理","DIG":"中甸","LJG":"丽江","LXA":"拉萨","TCG":"塔城","IQM":"且末","KCA":"库车","HTN":"和田","HMI":"哈密","FYN":"富蕴","AKU":"阿克苏","URC":"乌鲁木齐","KHG":"喀什","KRL":"库尔勒","KRY":"克拉玛依","AAT":"阿勒泰","YIN":"伊宁","TSN":"天津","AKA":"安康","ENY":"延安","HZG":"汉中","XIY":"西安","UYN":"榆林","CIH":"长治","TYN":"太原","DAT":"大同","YCU":"运城","TNA":"济南","YNT":"烟台","JNG":"济宁","DOY":"东营","LYI":"临沂","WEF":"潍坊","TAO":"青岛","WEH":"威海","GHN":"广汉","DAX":"达县","CTU":"成都","MIG":"绵阳","YBP":"宜宾","LZO":"泸州","XIC":"西昌","NAO":"南充","PZI":"攀枝花","GOQ":"格尔木","XNN":"西宁","ZHY":"中卫","INC":"银川","XIL":"锡林浩特","HLH":"乌兰浩特","WUA":"乌海","TGO":"通辽","HET":"呼和浩特","DSN":"鄂尔多斯","NZH":"满洲里","HLD":"海拉尔","CIF":"赤峰","BAV":"包头","CHG":"朝阳","SHE":"沈阳","DLC":"大连","DDG":"丹东","JNZ":"锦州","AOG":"鞍山","KHN":"南昌","JDZ":"景德镇","JIU":"庐山","KOW":"赣州","JGS":"井冈山","KNC":"吉安","LYG":"连云港","SZV":"苏州","YNZ":"盐城","XUZ":"徐州","NKG":"南京","NTG":"南通","CZX":"常州","WUX":"无锡","TNH":"通化","JIL":"吉林","CGQ":"长春","YNJ":"延吉","HJJ":"芷江","DYG":"张家界","CGD":"常德","CSX":"长沙","HNY":"衡阳","OHE":"漠河","HRB":"哈尔滨","HEK":"黑河","NDG":"齐齐哈尔","JMU":"佳木斯","MDG":"牡丹江","LYA":"洛阳","NNY":"南阳","CGO":"郑州","SJW":"石家庄","SHP":"秦皇岛","HDG":"邯郸","SHS":"沙市","WUH":"武汉","XFN":"襄樊","ENH":"恩施","YIH":"宜昌","HAK":"海口","SYX":"三亚","XYI":"兴义","KWE":"贵阳","TEN":"铜仁","ZYI":"遵义","BHY":"北海","KWL":"桂林","LZH":"柳州","NNG":"南宁","BAS":"百色","WUZ":"梧州","THQ":"天水","IQN":"庆阳","CHW":"酒泉","JGN":"嘉峪关","DNH":"敦煌","LHW":"兰州","ZHA":"湛江","MXZ":"梅县","ZUH":"珠海","SWA":"汕头","SZX":"深圳","CAN":"广州","XMN":"厦门","WUS":"武夷山","JJN":"晋江","LIC":"连城","FOC":"福州","WXN":"万州","CKG":"重庆","TXN":"黄山","BFU":"蚌埠","FUG":"阜阳","HFE":"合肥","PEK":"北京(首都)","NAY":"北京(南苑)","AVA":"安顺","AYN":"安阳","BPL":"博乐","CNI":"长海","BPX":"昌都","NBS":"长白山","DZU":"大足","DQA":"大庆","ERL":"二连浩特","FUO":"佛山","GYS":"广元","GYU":"固原","JZH":"九寨沟","JXA":"鸡西","KGT":"康定","KJI":"喀纳斯","LIA":"梁平","LLB":"荔波","HZH":"黎平","NLT":"那拉提","SXJ":"鄯善","HSC":"韶关","TVS":"唐山","TCZ":"腾冲","HYN":"黄岩","TLQ":"吐鲁番","WNH":"文山","WHU":"芜湖","XEN":"兴城","XIN":"兴宁","XNT":"邢台","LLF":"永州","YUS":"玉树","LDS":"伊春","HGH":"杭州","AQG":"安庆","HIA":"淮安","YTY":"扬州","JUH":"九华山"};
var dtime = new Date().toJSON().substr(0, 10).replace(/-/g, ''), cdat = [], log = function(){162==cdat.length?console.log('cdat='+JSON.stringify(cdat)):''};
for(j in city){
$.ajax({
type: "POST",
url: "https://flights.ctrip.com/itinerary/api/12808/lowestPrice",
contentType: "application/json",
dataType: "json",
jstr: city[j],
data: JSON.stringify({"flightWay":"Oneway","dcity":j.toLocaleLowerCase(),"acity":"kmg","army":false,"cabinFilter":["Y"]}),
success: function (res) {
var price = res.data.oneWayPrice[0], sprice = Object.keys(price).sort(function(a,b){return price[b]-price[a]}), nprice = [];
for(let i=0;i<sprice.length;i++){nprice[i] = [sprice[i], price[sprice[i]]]}
cdat.push({"n":this.jstr, "lt":nprice[nprice.length-1][0], "lp":nprice[nprice.length-1][1], "ht":nprice[0][0], "hp":nprice[0][1]}),log();
}
});
}}();

js.console携程近期低价机票信息的更多相关文章

  1. 解密国内BAT等大厂前端技术体系-携程篇(长文建议收藏)

    1 引言 为了了解当前前端的发展趋势,让我们从国内各大互联网大厂开始,了解他们的最新动态和未来规划.这是解密大厂前端技术体系的第四篇,前三篇已经讲述了阿里.腾讯.百度在前端技术这几年的技术发展. 这一 ...

  2. 微信小程序体验(1):携程酒店机票火车票

    在 12 月 28 日微信公开课上,张小龙对微信小程序的形态进行了阐释,小程序有四个特定:无需安装.触手可及.用完即走.无需卸载. 由于携程这种订酒店.火车票和机票等工具性质非常强的服务,非常符合张小 ...

  3. Webmagic 爬虫框架 爬取马蜂窝、携程旅游、汽车之家游记信息

    WebMagic学习 遇到的问题 Log4j错误 解决:在src目录下添加配置文件 log4j.properties log4j.rootLogger=INFO, stdout, file log4j ...

  4. 携程机票的ABTest实践

    携程ABTest伴随UBT(User Behavior Tracking System)系统一起,两年多的时间,从最初online寥寥几个实验,到现在单是机票BU每周就有数十个app/online/h ...

  5. 使用requests、re、BeautifulSoup、线程池爬取携程酒店信息并保存到Excel中

    import requests import json import re import csv import threadpool import time, random from bs4 impo ...

  6. 携程实时大数据平台演进:1/3 Storm应用已迁到JStorm

    携程大数据平台负责人张翼分享携程的实时大数据平台的迭代,按照时间线介绍采用的技术以及踩过的坑.携程最初基于稳定和成熟度选择了Storm+Kafka,解决了数据共享.资源控制.监控告警.依赖管理等问题之 ...

  7. 携程App的网络性能优化实践

    首先介绍一下携程App的网络服务架构.由于携程业务众多,开发资源导致无法全部使用Native来实现业务逻辑,因此有相当一部分频道基于Hybrid实现.网络通讯属于基础&业务框架层中基础设施的一 ...

  8. React Native实践之携程Moles框架

    编者:本文来自携程框架研发部高级经理魏晓军在第二期[携程技术微分享]上的分享,以下为整理后的文字实录.视频回放可点击这里.关注携程技术中心微信公号ctriptech,可获知更多微分享课程信息. 因为支 ...

  9. 携程React Native实践

    React Native(下文简称 RN)开源已经一年多时间,国内各大互联网公司都在使用,携程也在今年 5 月份投入资源开始引入,并推广给多个业务团队使用,本文将会分享我们遇到的一些问题以及我们的优化 ...

随机推荐

  1. 017.Oracle数据库,取今年第一天,取今年最后一天

    /*取今年第一天,取今年最后一天*/ SELECT trunc(sysdate, 'yyyy') AS 今年第一天 , add_months(trunc(sysdate, ) AS 今年最后一天 FR ...

  2. NIO组件Channel

    基本介绍 NIO的通道类似于流, 但有些区别: 通道可以同时进行读写, 而流只能读或者只能写 通道可以实现异步读写数据 通道可以从缓冲区(Buffer)读数据, 也可以写数据到缓冲区 BIO中的str ...

  3. Centos 8下普通用户增加root权限

    问题:     解决: 重启Centos,使用root登陆:                    

  4. MongoDB_01

    解释:MongoDB可应对 --三高需求 High performance-对数据库高并发读写的需求 Huge Storage -对海量数据的高效率存储和访问的需求 High Scalability ...

  5. Web安全测试学习笔记 - vulhub环境搭建

    Vulhub和DVWA一样,也是开源漏洞靶场,地址:https://github.com/vulhub/vulhub 环境搭建过程如下: 1. 下载和安装Ubuntu 16.04镜像,镜像地址:htt ...

  6. 4. Linux 集群安装

    1. 配置yum yum clean all yum makecache yum install wget 2.安装JDK (1) 将jdk-7u60-linux-i586.rpm通过WinSCP上传 ...

  7. gem5-gpu全系统模式

    # 注意:安装好gem5-gpu后再配置全系统环境 # 下载全系统模拟需要的工具,详见http://gem5.org/Running_gem5#Full_System_.28FS.29_Mode,将L ...

  8. tcp协议与dup协议知识总结

    在工作之余用xmind总结了一些UDP协议与TCP协议的知识点,如果有需要可以通过下方的留言,分享xmind文件和xmind软件.

  9. [CISCN2019 华北赛区 Day1 Web5]CyberPunk

    0x00 知识点 PHP伪协议直接读取源码 http://xxx.xxx/index.php?file=php://filter/convert.base64-encode/resource=inde ...

  10. Hbase PleaseHoldException错误

    PleaseHoldException ① 原因:(由于正在操作Hbase时,电脑突然关机,未正常关闭hbase,故导致shell无法正常显示)如下图: ②解决过程: 先在网上百度到了使用https: ...