js.console携程近期低价机票信息
!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携程近期低价机票信息的更多相关文章
- 解密国内BAT等大厂前端技术体系-携程篇(长文建议收藏)
1 引言 为了了解当前前端的发展趋势,让我们从国内各大互联网大厂开始,了解他们的最新动态和未来规划.这是解密大厂前端技术体系的第四篇,前三篇已经讲述了阿里.腾讯.百度在前端技术这几年的技术发展. 这一 ...
- 微信小程序体验(1):携程酒店机票火车票
在 12 月 28 日微信公开课上,张小龙对微信小程序的形态进行了阐释,小程序有四个特定:无需安装.触手可及.用完即走.无需卸载. 由于携程这种订酒店.火车票和机票等工具性质非常强的服务,非常符合张小 ...
- Webmagic 爬虫框架 爬取马蜂窝、携程旅游、汽车之家游记信息
WebMagic学习 遇到的问题 Log4j错误 解决:在src目录下添加配置文件 log4j.properties log4j.rootLogger=INFO, stdout, file log4j ...
- 携程机票的ABTest实践
携程ABTest伴随UBT(User Behavior Tracking System)系统一起,两年多的时间,从最初online寥寥几个实验,到现在单是机票BU每周就有数十个app/online/h ...
- 使用requests、re、BeautifulSoup、线程池爬取携程酒店信息并保存到Excel中
import requests import json import re import csv import threadpool import time, random from bs4 impo ...
- 携程实时大数据平台演进:1/3 Storm应用已迁到JStorm
携程大数据平台负责人张翼分享携程的实时大数据平台的迭代,按照时间线介绍采用的技术以及踩过的坑.携程最初基于稳定和成熟度选择了Storm+Kafka,解决了数据共享.资源控制.监控告警.依赖管理等问题之 ...
- 携程App的网络性能优化实践
首先介绍一下携程App的网络服务架构.由于携程业务众多,开发资源导致无法全部使用Native来实现业务逻辑,因此有相当一部分频道基于Hybrid实现.网络通讯属于基础&业务框架层中基础设施的一 ...
- React Native实践之携程Moles框架
编者:本文来自携程框架研发部高级经理魏晓军在第二期[携程技术微分享]上的分享,以下为整理后的文字实录.视频回放可点击这里.关注携程技术中心微信公号ctriptech,可获知更多微分享课程信息. 因为支 ...
- 携程React Native实践
React Native(下文简称 RN)开源已经一年多时间,国内各大互联网公司都在使用,携程也在今年 5 月份投入资源开始引入,并推广给多个业务团队使用,本文将会分享我们遇到的一些问题以及我们的优化 ...
随机推荐
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-off
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...
- 官网英文版学习——RabbitMQ学习笔记(九)总结
RabbitMQ与spingboot相整合,主要步骤也很简单: 一.首先需要的是添加依赖 二.需要设置属性,属性主要是设置rabbitmq的地址端口,用户名密码回调等需要用到的一些常量,在整合过程中, ...
- jsp与spring mvc后台controller间参数传递处理之总结
在编程过程中,最容易出现问题及卡壳的地方,往往是各层之间接缝处,接缝处往往存在着各种各样的参数传递,数据转换和格式化,参数很好的传递并正确接收过来之后就是复杂逻辑之间的处理了,所以为了避免多种问题占用 ...
- java中vector、ArrayList、LinkedList的区别
转 首先看这两类都实现List接口,而List接口一共有三个实现类,分别是ArrayList.Vector和LinkedList.List用于存放多个元素,能够维护元素的次序,并且允许元素的重复.3个 ...
- R语言 线性回归分析实例 《回归分析与线性统计模型》page72
y,X1,X2,X3 分别表示第 t 年各项税收收入(亿元),某国生产总值GDP(亿元),财政支出(亿元)和商品零售价格指数(%). (1) 建立线性模型: ① 自己编写函数: > librar ...
- 一百零五、SAP中ALV事件之十七,让ALV表格修改后保存到数据库
一.我们来到代码界面设置保存按钮的代码 二.i_grid_settings这个属性用来编辑单元格之后,返回给程序编辑后的值 三.我们双击点 'REUSE_ALV_GRID_DISPLAY',来到定义 ...
- 118-PHP调用带参数的成员方法
<?php class ren{ //定义人类 public function info($name,$age=3){ //定义有两个参数的成员方法 echo "我是{$name},年 ...
- jQuery原理系列-工具函数
jquery源码中有很多精妙的实现,对于我们每天都在使用的东西,一定要知其原理,如果遇到不能使用jquery环境,也能自己封装原生的代码实现. 1.检测类型 众所周知typeof 不能用来检测数据,会 ...
- JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色
JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色 1:现在公司中使用mybatis的频率非常高,一般都会用MBG来生成基础的代码文件.在intellij中查看 ...
- ACM-Special Array
题目描述:Special array 输入n和m(20>=m>=n>0)求出所有满足以下方程的正整数数列 i1,i2,...,in,使i1+i2+...+in=m,且i1> ...