PageSourceSearch

https://jejuallpass.com/www/js/weather_banner3.js?v=1.0.1

js jejuallpass.com collected 2026-10-08 23:31:28 UTC 4,792 bytes, 154 lines download raw bytes

1/**
2 * Open Weather Map
3 * https://openweathermap.org/
4 *
5 * Weather API
6 * Current weather data By city name
7 */
8
9/**
10 * The World Air Quality Project
11 * http://aqicn.org/api/
12 *
13 * Real-time Air Quality - JSON API
14 * This API is provided by the World Air Quality Index project
15 * City Feed - city/station feed
16 * http://aqicn.org/json-api/doc/
17 */
18
19$(document).ready(function() {
20
21	var city = "Jeju,KR";	//도시,나라
22	var units = "metric"; //온도 단위 - 섭씨 설정
23	var apiKey = "d49bf60efc7b630f5a6594ea3a752eea";
24
25	//날씨 API 연동
26	$.ajax({
27		url: window.document.location.protocol + "//api.openweathermap.org/data/2.5/weather?q="+ city +"&units="+ units +"&APPID="+ apiKey,
28		dataType: "json",
29		type: "GET",
30		success: function(weather) {
31			var code = weather.weather[0].icon;		//날씨 코드
32			var weatherIcon = null;	//날씨 아이콘
33
34			//Clear Sky
35			if(code == "01d" || code == "01n") {
36				weatherIcon = "w_1";	//맑음
37			}
38			//Few Clouds
39			else if(code == "02d" || code == "02n") {
40				weatherIcon = "w_3";	//구름 조금
41			}
42			//Scattered Clods
43			else if(code == "03d" || code == "03n") {
44				weatherIcon = "w_2";	//구름
45			}
46			//Broken Clouds
47			else if(code == "04d" || code == "04n") {
48				weatherIcon = "w_2";	//구름
49			}
50			//Shower Rain
51			else if(code == "09d" || code == "09n") {
52				weatherIcon = "w_5";	//비
53			}
54			//Rain
55			else if(code == "10d" || code == "10n") {
56				weatherIcon = "w_5";	//비
57			}
58			//Thunderstrom
59			else if(code == "11d" || code == "11n") {
60				weatherIcon = "w_7";	//뇌우
61			}
62			//Snow
63			else if(code == "13d" || code == "13n") {
64				weatherIcon = "w_4";	//눈
65			}
66			//Mist
67			else if(code == "50d" || code == "50n") {
68				weatherIcon = "w_6";	//안개
69			}
70
71			var aqiToken ="f0be0ee5f4027e54d48d458c05f8047ee567f448";
72
73			//미세먼지 API 연동
74			$.ajax({
75				url: "https://api.waqi.info/feed/korea/jeju/jeju-si/?token="+aqiToken,
76				dataType: "json",
77				type: "GET",
78				success: function(dust) {
79					var aqi = dust.data.aqi;	//대기 질 지수
80
81					var grade = "";	//등급
82					var gradeColor = "";	//등급별 색상코드
83					var gradePosition = ""; //등급 폰트 위치
84					var gradeSize = "";	//등급 폰트 사이즈
85
86					//AQI: 0~51 - 좋음
87					if(aqi > 0  && aqi < 51) {
88						grade = "좋음";
89						gradeColor = "#0cb7c7";
90						gradePosition = "12%";
91						gradeSize = "28px";
92					}
93					//AQI: 51~100 - 보통
94					else if(aqi > 50  && aqi < 101) {
95						grade = "보통";
96						gradeColor = "#00bc68";
97						gradePosition = "12%";
98						gradeSize = "28px";
99					}
100					//AQI: 101~150 - 약간나쁨
101					else if(aqi > 100  && aqi < 151) {
102						grade = "약간나쁨";
103						gradeColor = "#ffcb38";
104						gradePosition = "5%";
105						gradeSize = "25px";
106					}
107					//AQI: 151~200 - 나쁨
108					else if(aqi > 150  && aqi < 201) {
109						grade = "나쁨";
110						gradeColor = "#ff8f00";
111						gradePosition = "12%";
112						gradeSize = "28px";
113					}
114					//AQI: 201~300이상 - 매우나쁨
115					else if(aqi > 200) {
116						grade = "매우나쁨";
117						gradeColor = "#ff0000";
118						gradePosition = "5%";
119						gradeSize = "25px";
120					}
121
122					//날씨 배너 추가
123					$(".weather_banner")
124					//.append("<img src='/www/images/common/weather/weather_bg.jpg' alt='날씨&미세먼지'/>")
125					.append($("<div class='weather_info'>")
126							.append($("<ul>")
127									//.append($("<li class='weather_area'>")
128											//.append($("<p>").append("제주, 제주시")))
129									.append($("<li class='weather_icon'>")
130											.append("<img src='/www/images/common/weather/"+weatherIcon+".png'/>")
131											.append($("<p>").append("제주, 제주시")
132											//.append($("<span>").append(weather.main.temp+"<span>"+"℃"))
133											.append($("<span>").append(Math.round(weather.main.temp)+"<span>"+"℃"))
134									)
135							)
136									.append($("<li class='finedust_icon'>")
137											.append("<img src='/www/images/common/weather/mask.png'/>")
138											.append($("<span style='color: "+gradeColor+"; margin-left: "+gradePosition+"; font-size: "+gradeSize+";'>").append(grade)))));
139
140					$(".weather_banner").click(function() {
141						//실내 관광지 추천
142						if(code == "09d" || code == "09n" || code == "10d" || code == "10n" || code == "11d" || code == "11n" || code == "13d" || code == "13n" || code == "50d" || code == "50n" || aqi > 150) {
143							$(location).attr("href", "/www/item/coupon.html?sno=1025&s_cate=151");
144						}
145						//실외 관광지 추천
146						else {
147							$(location).attr("href", "/www/item/coupon.html?sno=1025&s_cate=167");
148						}
149					});
150				}
151			});
152		}
153	});
154});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.