/ / WeatherRoom सेवा को वेबसाइट के लिए एक विकल्प की आवश्यकता है - एक्सएमएल, फ्लैश, एक्शनस्क्रिप्ट

WeatherRoom सेवा को वेबसाइट के लिए एक विकल्प की आवश्यकता है - एक्सएमएल, फ्लैश, एक्शनस्क्रिप्ट

ठीक है मैं एक्शनस्क्रिप्ट का उपयोग नहीं करता और मदद करने की कोशिश नहीं करता हूंमेरा दोस्त एक फ्लैश वेबसाइट संपादित करता है जो लेआउट बदलता है weatherroom.com से एक्सएमएल फ़ीड के आधार पर जो अब डिफंक हो गया है, इस साइट के देव ने भी मेरे दोस्त (उसके ग्राहक) को छोड़ दिया है। यह वर्तमान कोड है, वैसे भी मैं बस किसी अन्य सेवा के लिए स्वैप कर सकता हूं और किसी व्यक्ति को एक्शनस्क्रिप्ट करने के लिए किसी व्यक्ति को किराए पर नहीं लेना पड़ता

updateWeatherData() {
//record old settings
var oldCondition = _root.currentCondition;
var oldWeather = _root.currentWeather;
var oldTimeset = _root.currentTimeset;
//get new settings
var newTimeObj = _root.getCurNYTime();
_root.currentTimeset = newTimeObj.timeSet /*"night"*/;
var myURL:String = "http://www.weatherroom.com/xml/zip/12545";
var myXMLweatherData:XML = new XML();
myXMLweatherData.load(myURL);
myXMLweatherData.onLoad = function(success) {
if (success) {
_root.XMLWeatherFeed = this;
//extract current condition (string)
_root.currentCondition = _root.getCurrentCondition(_root.XMLWeatherFeed);
//get current weather number
_root.currentWeather = _root.getCurrentWeather(_root.currentCondition) /*2*/;
//display
_root.displayAllWeatherInfo(_root.XMLWeatherFeed);
if (_root.initWeatherDone == true) {
//compare if weather has changed
if (oldCondition != _root.currentCondition or oldWeather != _root.currentWeather or oldTimeset != _root.currentTimeset) {
if (_root.currentCondition != undefined and _root.currentWeather != undefined and _root.currentTimeset != undefined) {
console.text += ("-> " + oldCondition + " :: " + _root.currentCondition + "n");
console.text += ("-> " + oldWeather + " :: " + _root.currentWeather + "n");
console.text += ("-> " + oldTimeset + " :: " + _root.currentTimeset + "n");
//if it has, launch weather update
_root.updateWeatherBackground();
} else {
console.text += ("--! weather server returned uncomplete data !--");
//restore data
_root.currentCondition = oldCondition;
_root.currentWeather = oldWeather;
_root.currentTimeset = oldTimeset;
}
} else {
console.text += ("--! no necessary update !--");
}
} else {
//tell app init has been done
_root.initWeatherDone = true;
}
} else {
//-- server is down
//-- return partly cloudy no rain
trace("*** SERVER IS DOWN ***");
_root.currentWeather = 3;
_root.initWeatherDone = true;
}
}

}

उत्तर:

उत्तर № 1 के लिए 1

आपको शायद किसी को किराए पर लेने की आवश्यकता होगीअन्य। कारण मैं कहता हूं कि यह है कि आपके द्वारा उपयोग की जाने वाली कोई भी अन्य सेवा आपके कोड के लिए बिल्कुल उसी XML लेआउट को "इसमें प्लग करने" के लिए होगी। उदाहरण के लिए, _root.getCurrentCondition() शायद एक तरीका है जो एक विशिष्ट दिखता हैएक्सएमएल के अंदर नोड और एक विशिष्ट प्रारूप में एक मूल्य देता है। जब तक गुण और टेक्स्ट बिल्कुल समान नहीं होते (नाम, पैटर्न, आदि), यह सिर्फ काम नहीं करेगा।

सौभाग्य।