!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. git commit -m 和 git commit -am 区别

    git commit -m 和 git commit -am 通常修改一个文件 并且将文件提交到本地分支的命令是: git add . git commit -m 'update' 以上两个命令其实可 ...

  2. JuJu团队12月3号工作汇报

    JuJu团队12月3号工作汇报 JuJu   Scrum 团队成员 今日工作 剩余任务 困难 于达 修改batch里给sentence加padding的方法 继续调试 无 婷婷 给crossentro ...

  3. Day 28:SAX解析原理

    SAX解析 回顾DOM解析 DOM解析原理:一次性把xml文档加载进内存,然后在内存中构建Document树. 缺点: 不适合读取大容量的xml文件,容易导致内存溢出. SAX解析原理: 加载一点,读 ...

  4. SpringBoot启动流程分析

    前景提示 @ComponentScan  的处理都放在org.springframework.context.annotation.ConfigurationClassParser#doProcess ...

  5. Shell脚本之awk篇

    目录:一.概述二.awk基本语法格式三.awk基本操作四.awk条件及循环语句五.awk函数六.awk演示示例(源自于man手册) 一.概述 1. 产品概述: awk是一种编程语言,用于在linux/ ...

  6. golang 读取 chrome保存的网站账号信息

    package main import ( "database/sql" "fmt" "log" "os" " ...

  7. (二)Spring初步搭建、IOC创建对象

    环境准备: 见java环境搭建 新建maven项目,同时搭好项目结构,新建相应的包 Spring的初步搭建 1.导入jar包,Spring版本为5.1.10,同时导入junit包 <depend ...

  8. java中JDBC当中请给出一个DataSource的HelloWorld例子

    在前面 的jdbc的Helloworld程序当中,我们用DriverManager来获取数据库连接.事实上通过这种方法获取数据库连接,是比较耗费计算机资 源的.当然了,这也是没有办法的事儿.就像我们买 ...

  9. Hadoop组件详解(随缘摸虾)

    1.1. Hadoop组成: Hadoop = hdfs(存储) + mapreduce(计算) + yarn(资源协调) + common(工具包) + ozone(对象存储) + submarin ...

  10. c++程序—浮点数

    #include<iostream> using namespace std; int main() { //2.单精度float //3.双精度double //默认情况下会输出6位有效 ...