magicman Posted May 18, 2010 #1 Share Posted May 18, 2010 καλησπερα, κανω ενα script που παιρνει σαν παραμετρους, πολεις κ απο ενα λινκ μετεορολογικο πχ http://www.wunderground.com/cgi-bin/findweather/getForecast?query=thessaloniki&wuSelect=WEATHER&MR=1με την get πρεπει να εμφανιζω την θερμοκρασια στην πολη αυτη...δλδ thessaloniki 5 oCεχει δουλεψει κανεις την get με αυτο τον τροπο?ευχαριστω.. Link to comment Share on other sites More sharing options...
oxide Posted May 19, 2010 #2 Share Posted May 19, 2010 το κανεις για να εξασκηθεις?αλλιως υπαρχουν απειρα desklets και στο ubuntu (αν εχεις αυτο) υπαρχει και στα προσθετα απο τις μπαρες.. Link to comment Share on other sites More sharing options...
magicman Posted May 19, 2010 Author #3 Share Posted May 19, 2010 ασκηση εργαστηριου ειναι ρε...η get αποτι ειδα κατεβαζει το site κ μπορεις να το στειλεις πχ σε ενα file, και εκει ειναι ο κωδικας την σελιδας.αλλα απο εκει κ περα πως θα παρω την θερμοκρασια δεν ξερω.. Link to comment Share on other sites More sharing options...
Jaco Posted May 19, 2010 #4 Share Posted May 19, 2010 Γιατί δεν χρησιμοποιείς την wget και μετά με grep να πάρεις αυτά που θες...?Πρέπει να είναι συγκεκριμένα η get...? είναι πιο μανούρα βασικά, χωρίς ουσιαστικό λόγο. Link to comment Share on other sites More sharing options...
magicman Posted May 19, 2010 Author #5 Share Posted May 19, 2010 η εκφωνηση ειναι λιγο ΄΄φλου΄΄ απλα σαν tip το δινει.ωραια βλεπω ειναι καλυτερα, με την wget, κ τωρα grep τι ομως? Link to comment Share on other sites More sharing options...
Jaco Posted May 19, 2010 #6 Share Posted May 19, 2010 Σου είπα τα συστατικά, η μαγειρική είναι δικιά σου... εργαστήριο είναι... Link to comment Share on other sites More sharing options...
magicman Posted May 19, 2010 Author #7 Share Posted May 19, 2010 θα το βρω που θα παει. :computer: Link to comment Share on other sites More sharing options...
oxide Posted May 22, 2010 #8 Share Posted May 22, 2010 αν το κανεις στειλε την λυση εχω περιεργεια για το πως θα ψαξεις μεσα στην σελιδα.. Link to comment Share on other sites More sharing options...
magicman Posted June 2, 2010 Author #9 Share Posted June 2, 2010 ετσι για την ιστορια η λυση#!/bin/bashif [ $# -eq 0 ]; then echo "ERROR!!! You need to give parameters!!!" exit 1fifor city in $@do GET "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=$city&wuSelect=WEATHER" | grep '^.*tempf.*$'>a head -1 a >b c=`sed 's/..*\([0-9][0-9]\)..*/\1/g' b` temp=$(($c-32)) temper=$((temp*5)) temperature=$(($temper/9)) if [ $temperature -eq -17 ]; then echo "$city : ?" else echo "$city : $temperature" fidone 1 Link to comment Share on other sites More sharing options...
oxide Posted June 3, 2010 #10 Share Posted June 3, 2010 ωραιος αξιζει να το μελετησω λιγο.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now