當前位置:首頁 » 操作系統 » 天氣預報網站源碼

天氣預報網站源碼

發布時間: 2022-05-29 23:10:16

❶ 最好的網頁天氣預報代碼(自動定製城市天氣)

這是你想要的天氣預報代碼,由中央氣象台提供數據,最准確最權威的天氣預報,能夠根據訪客不同的IP地址顯示不同城市的天氣預報
下面是源程序代碼:

<iframe src="http://www.ttyyy.com/tianqi/tq.html" width="160" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>

❷ 求內網網頁天氣預報源代碼!

如果你的內網能接入互聯網,還分什麼內網外網,網上的調用代碼應該都可以用才對
如果內網不能接入互聯網,那你還是每天手動錄吧

❸ 誰有 15天天氣預報 源碼 最好是PHP的 或者API介面

你好可以使用中國天氣網的天氣插件 比較好用我就用這個

❹ 求網站中加入天氣預報的代碼

下面這段是它的源文件
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>07越秀</title>
<link href="../css/ddg.css" rel="stylesheet" type="text/css">
</head>

<body style="background-color:transparent">

<table width="100%" height="80" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15"><img src="images/spacer.gif" width="1" height="8" /></td>
</tr>
<tr>
<td width="60" align="center" valign="top"><!--5-12修改6開始--><img src="http://weather.news.163.com/weather/images/logo/01.gif" alt="" /><img src="http://weather.news.163.com/weather/images/logo/03.gif" alt="" /><!--5-12修改6結束--></td>
<td align="left" valign="top"><font id="dateFont">2007年1月16日<br />
星期二 下午17:02<br />
</font>
<script>
var day = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
function showDate()
{
font = document.getElementById("dateFont");
var now = new Date();
var str = "";
var hours = now.getHours() + "";
if(hours.length < 2)
{
hours = "0" + hours;
}
var minutes = now.getMinutes() + "";
if(minutes.length < 2)
{
minutes = "0" + minutes;
}
var seconds = now.getSeconds() + "";
if(seconds.length < 2)
{
seconds = "0" + seconds;
}
str += "<font style=\"color:#000000;\"><b>" + now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日</b></font><br><font style=\"color:#EB7002;\">" + day[now.getDay()] + " " + hours + ":" + minutes + ":" + seconds + "</font><br>";
font.innerHTML = str;
}
setInterval("showDate()" , 1000);
</script>
<font style="color:#EB7002;">
多雲轉陣雨 25℃~34℃
</font></td>
</tr>
<tr>
<td height="8"><img src="images/spacer.gif" width="1" height="8" /></td>
</tr>
</table>

</body>
</html>

再給你推薦一個根據不同IP顯示不同地區的代碼:
<iframe src="http://www.ttyyy.com/tianqi/tq.html" width="160" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
都試試吧

❺ hao123網站左上的天氣預報網頁代碼是什麼

hao123網站左上的天氣預報網頁代碼如下:

<iframe src=

"http://www.tianqi123.com/small_page/chengshi_2250.html?

c0=red&c1=D96C00&bg=F4FFF4&w=178&h=20&text=yes"

width=178 height=21

marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no

align=center id=url></iframe>

製作網頁時常用的代碼有HTML,javaScript,ASP,PHP,CGI等,其中超文本標記語言(標准通用標記語言下的一個應用、外語簡稱:HTML)是最基礎的網頁代碼。

(5)天氣預報網站源碼擴展閱讀:

網頁代碼的一些簡單使用:

<marquee>...</marquee>普通卷動

<marquee behavior=slide>...</marquee>滑動

<marquee behavior=scroll>...</marquee>預設卷動

<marquee behavior=alternate>...</marquee>來回卷動

<marquee direction=down>...</marquee>向下卷動

<h1>...</h1>標題字(最大 )

<h6>...</h6>標題字(最小)

<b>...</b>粗體字

<strong>...</strong>粗體字(強調)

<br>(換行)

<nobr>...</nobr>水域(不換行)

<p>...</p>水域(段落)

<center>...</center>置中

❻ 求Android天氣預報的開發源代碼

package com.nrzc.weatherstation;

import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import java.util.Timer;
import java.util.TimerTask;

/**
* 環境感測器
* 氣象站
*/
public class MainActivity extends AppCompatActivity {

private SensorManager sensorManager;
private TextView temperatureTextView;
private TextView pressureTextView;
private TextView lightTextView;

private float currentTemperature=Float.NaN;
private float currentPressure=Float.NaN;
private float currentLight=Float.NaN;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

init();

Timer updateTimer=new Timer("weatherUpdate");
updateTimer.scheleAtFixedRate(new TimerTask() {
@Override
public void run() {
updateGUI();
}
},0,1000);
}

private void init(){
temperatureTextView=(TextView)findViewById(R.id.temperature);
pressureTextView=(TextView)findViewById(R.id.pressure);
lightTextView=(TextView)findViewById(R.id.light);
sensorManager=(SensorManager)getSystemService(Context.SENSOR_SERVICE);

}

private final SensorEventListener tempSensorEventListener=new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
currentTemperature=event.values[0];
}

@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {

}
};

private final SensorEventListener pressureSensorEventListener=new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
currentPressure=event.values[0];
}

@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {

}
};

private final SensorEventListener lightSensorEventListener=new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
currentLight=event.values[0];
}

@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {

}
};

@Override
protected void onResume() {
super.onResume();

Sensor lightSensor=sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
if (lightSensor!=null)
sensorManager.registerListener(lightSensorEventListener,
lightSensor,
SensorManager.SENSOR_DELAY_NORMAL);
else
lightTextView.setText("Light Sensor Unavailable");

Sensor pressureSensor=sensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
if (pressureSensor!=null)
sensorManager.registerListener(pressureSensorEventListener,
pressureSensor,SensorManager.SENSOR_DELAY_NORMAL);
else
pressureTextView.setText("Barometer Unavailable");

Sensor temperatureSensor=sensorManager.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);
if (temperatureSensor!=null)
sensorManager.registerListener(tempSensorEventListener,
temperatureSensor,
SensorManager.SENSOR_DELAY_NORMAL);
else
temperatureTextView.setText("Thermometer Unavailable");
}

@Override
protected void onPause() {
sensorManager.unregisterListener(pressureSensorEventListener);
sensorManager.unregisterListener(tempSensorEventListener);
sensorManager.unregisterListener(lightSensorEventListener);
super.onPause();
}

private void updateGUI(){
runOnUiThread(new Runnable() {
@Override
public void run() {
if(!Float.isNaN(currentPressure)){
pressureTextView.setText(currentPressure+"hPa");
pressureTextView.invalidate();
}
if (!Float.isNaN(currentLight)){
String lightStr="Sunny";
if (currentLight<=SensorManager.LIGHT_CLOUDY)
lightStr="night";
else if (currentLight<=SensorManager.LIGHT_OVERCAST)
lightStr="Cloudy";
else if (currentLight<=SensorManager.LIGHT_SUNLIGHT)
lightStr="Overcast";
lightTextView.setText(lightStr);
lightTextView.invalidate();
}

if (!Float.isNaN(currentTemperature)){
temperatureTextView.setText(currentTemperature+"C");
temperatureTextView.invalidate();
}
}
});
}

}

❼ 請問下誰知道hao123上天氣預報的源代碼是什麼

<script src=" http://www.hao123.com/js/base.js?v=1.1"></script>
<script type="text/javascript" src=" http://www.hao123.com/js/weather_index.js?v=1.0" language="javascript"></script>
<DIV id=TopBar><SPAN id=Forecast></SPAN></DIV>

❽ 求天氣預報網站代碼(有要求)

<iframe
src="http://m.weather.com.cn/m/p6/weather1.htm"
width="220"
height="30"
marginwidth="0"
marginheight="0"
hspace="0"
vspace="0"
frameborder="0"
scrolling="No"></iframe>
上面這段代碼顯示的是訪問這個網站的人所在城市的天氣情況。
如果需要設置城市的話可以訪問這個網址:
http://www.tianqi123.com/main/small_page.html?url=http://www.tianqi123.com/tianqi/chengshi_1.html&city_name=北京
根據需要輸入城市名稱,生成你想要的代碼

熱點內容
世界資產配置是什麼 發布:2024-10-28 23:23:03 瀏覽:530
2022款軒逸哪個配置性比價高 發布:2024-10-28 23:21:25 瀏覽:956
專業java就業培訓 發布:2024-10-28 22:59:52 瀏覽:121
安卓手機音效卡轉換器哪個好 發布:2024-10-28 22:57:39 瀏覽:10
公積金怎麼查詢賬號密碼 發布:2024-10-28 22:43:33 瀏覽:156
電視路由器哪裡是網路密碼 發布:2024-10-28 22:43:32 瀏覽:827
python爬蟲教程pdf 發布:2024-10-28 22:39:15 瀏覽:893
哪個微信安卓版本好用 發布:2024-10-28 22:22:10 瀏覽:342
net調用java介面 發布:2024-10-28 22:21:58 瀏覽:475
c語言輸入單個字元 發布:2024-10-28 22:20:58 瀏覽:429