当前位置:首页 » 操作系统 » 天气预报网站源码

天气预报网站源码

发布时间: 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=北京
根据需要输入城市名称,生成你想要的代码

热点内容
md5c语言加密算法 发布:2024-10-28 21:16:45 浏览:459
数据库在哪找建立的存储过程 发布:2024-10-28 20:49:19 浏览:576
如何查看安卓编译变量值 发布:2024-10-28 20:37:13 浏览:722
内网搭建dns服务器 发布:2024-10-28 20:13:42 浏览:119
头条上传视频失败 发布:2024-10-28 20:12:49 浏览:66
java多文件 发布:2024-10-28 20:11:53 浏览:805
oppo手机怎样取消应用加密 发布:2024-10-28 19:59:08 浏览:3
pythonstring方法 发布:2024-10-28 19:59:06 浏览:940
安卓和苹果哪个玩游戏快 发布:2024-10-28 19:37:02 浏览:73
c语言定义函数数组 发布:2024-10-28 19:09:49 浏览:602