Conky and noaa weather from xml

i am looking into trying to retrieve weather data from noaa xml file for locations then displaying it in conky. i am having trouble just extracting the data i want without downloading the xml file to the computer let alone getting it to appear in conky.
i have tried wget | grep but all that happens is the file gets downloaded and grep part does nothing.
can someone point me in the right direction  that may help me
thanks.

I really don't know where I learned all this, mostly just google over time.
I believe that the weather station you are using is from La Guardia airport which is KLGA.
You can perhaps find a better station here.
Below is a script you may modify to suit your needs.
A little information about the script.  It uses wget to download the file into in /tmp/weather. On Arch Linux, /tmp is not actually on disk, but is in shared memory.  Thus the .xml file will be downloaded into shared memory.
Since it appears that the weather data is updated once per hour (as near as I can tell), the script will not try to retrieve new data until at least one hour and 15 minutes after the last observed time.  (I chose 1:15 since at La Guardia at least, there is about a 11 minute delay between when they make a weather observation and put the data online.) If the new data is still old (which could happen if the weather station is having problems or maintenence, etc.) then the script will keep trying to get new data roughly once every five minutes until the station comes back on line.
The script takes the weather station (KLGA for instance) as a command line parameter so you could easily use a different station.
#!/bin/bash
station="$1.xml"
wdir='/tmp/weather'
update_xml() {
if [ ! -e "$station" ]; then
wget -q http://w1.weather.gov/xml/current_obs/${station}
[ -e "$station" ] && touch "${station}"
else
# dtime: time the .xml file was downloaded
# otime: time the weather data was observed
# ctime: current time (time this script is being run)
dtime=$(stat -c %Y $station)
otime=$(date -d "$utime" +%s)
ctime=$(date +%s)
if (( "$otime" + 4507 < "$ctime" )); then
if (( "$dtime" + 307 < "$ctime" )); then
wget -q -O "$station" http://w1.weather.gov/xml/current_obs/${station}
[ -e "$station" ] && touch "${station}"
fi
fi
fi
from_xml() { xmllint -xpath "//$1" - <<< "$xml" | sed 's/<[^>]*>//g'; }
[ -d "$wdir" ] || mkdir -p "$wdir"
cd "$wdir" || exit 1
xml=''
[ -r $station ] && xml="$(< $station)"
( update_xml >/dev/null 2>&1 ) &
if [ -n "$xml" ]; then
location=$(from_xml "location")
utime=$(from_xml "observation_time_rfc822")
weather=$(from_xml "weather")
temperature=$(from_xml "temp_f")
humid=$(from_xml "relative_humidity")
wind_dir=$(from_xml "wind_dir")
case "$wind_dir" in
"North") wind_dir="N" ;;
"South") wind_dir="S" ;;
"East") wind_dir="E" ;;
"West") wind_dir="W" ;;
"Northwest") wind_dir="NW" ;;
"Northeast") wind_dir="NE" ;;
"Southwest") wind_dir="SW" ;;
"Southeast") wind_dir="SE" ;;
esac
wind_speed=$(from_xml "wind_kt")
baro_pressure=$(from_xml "pressure_in")
echo "$location"
echo "Updated: $(date -d "$utime" 2>/dev/null )"
printf 'Weather: %s %s°F\n' "$weather" "$temperature"
printf 'Barometric Pressure: %s inches\n' "$baro_pressure"
printf 'Wind: %s at %s knots\n' "$wind_dir" "$wind_speed"
printf 'Humidity: %s%%\n' "$humid"
else
echo "No weather data available."
fi
Then in your .conkyrc do (don't forget the KLGA):
${exec /path/to/script KLGA}
Finally, I see that there are also a set of thumbnail images that NOAA provides that coorespond to the current weather conditions. As conky is capable of displaying these thumbnails, you could set up conky to do that as well.  It is a little more involved, so let me know if you are interested.

Similar Messages

  • How to remove a font file and its mapping from XML Publisher Administrator

    Hello,
    I am trying to remove a font file and its mapping from the XML Publisher Administrator. If this is not possible, is there a way to disable it?
    The reason why I am asking this is because we just got a new check printer, and I was able to print just fine. However, the MICR font was not coming up properly on the check, so I went ahead and configured the font with the XML Publisher Administrator. Now my check output is coming up blank after running the XML report publisher program. The only change I did was to upload the MICR font and mapped it.
    My template and rdf report file are working fine in another environment we have, so I know that's not the problem.
    Any help is appreciate it.
    Thanks.

    This is how you do it
    Font
    DELETE FROM xdo_lobs
    where lob_code like '<Font_name>';
    Font Mapping Set
    DELETE FROM xdo_font_mapping_sets_TL
    WHERE mapping_code like '<MAPPING_CODE>'

  • 1.6 Dynamic Photo Gallery - alt and title attributes from xml file?

    Hi!
    I would like to attach information to my gallery images from
    the XML-file used by the gallery.
    Especially the alt and title attributes for the "img
    id="mainImage"-tag would add a bit more user friendliness.
    I found
    this
    example about adding caption to images very help full and
    everything worked just fine, thanks to clear information!
    (http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadi d=1306782&enterthread=y)
    Could someone come up with an example of adding title/alt
    attributes values from XML file?
    I'm sure there are quite a few out ther who would like to see
    a solution to this ;)

    You need to add your info to the XML.
    So something like:
    <photo
    path = "travel_01.jpg"
    width = "263"
    height = "350"
    title="my title"
    alt_text="Alt Text"
    thumbpath = "travel_01.jpg"
    thumbwidth = "56"
    thumbheight = "75">
    </photo>
    Then in your detailregion:
    <img src="{dsData::large/@base}{@path}" alt="{@alt_text}
    title="{@title}" />
    I am using
    http://www.adobe.com/devnet/dreamweaver/articles/spry_photo_album.html
    as the source of my samples...
    So, just add the data to the XML and then you will have these
    attributes available as data references.
    Hope this helps.
    Don

  • BPEL assign count and node value from xml

    I have mapnames.xml in the project with nodes like this:
    <mapname>STATUS_DIMS_LOAD</mapname>
    <mapname>MOVEMENT_DIMS_LOAD</mapname>
    The xml of mapnames will be used for an input variable for a FlowN invoke.
    Trying to count the number of mapnames in the xml document and put in a variable.
    <assign name="getMapNamesN">
    <copy>
    <from expression= *"count(bpws:getVariableData('... ? " />*
    <to variable="FlowN_Dims_Count"/>
    </copy>
    </assign>
    Then use that in the FlowN
    <bpelx:flowN name="FlowN_Dims" N="bpws:getVariableData('Flow_Dims_Count')" indexVariable="Index">
    And then inside the FlowN, get the actual mapname using the index.
    <assign name="Assign_Dims">
    <copy>
    <from expression= *"bpws:getVariableData('... ? [',bwps:getVariableData('Index'),']') " />*
    <to variable="Invoke_Dims_InputVariable" part="InputParameters"
    query="/ns8:InputParameters/ns8:P_MAPNAME" />
    </copy>
    </assign>
    What is the syntax to
    1. Count the number of mapnames in the xml document?
    2. Use the FlowN index to assign the mapname to an input variable?

    That looked hopeful, but it did not show how to create the variables and I do not know the syntax for making an array variable.

  • How to get the column name and table name from xml file

    I have one XML file, I generated xsd file from that xml file but the problem is i dont know table name and column name. So my question is how can I retrieve the data from that xml file?

    Here's an example using binary XML storage (instead of Object-Relational storage as described in the article).
    begin
      dbms_xmlschema.registerSchema(
        schemaURL       => 'my_schema.xsd'
      , schemaDoc       => xmltype(bfilename('TEST_DIR','my_schema.xsd'), nls_charset_id('AL32UTF8'))
      , local           => true
      , genTypes        => false
      , genTables       => true
      , enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS
      , options         => dbms_xmlschema.REGISTER_BINARYXML
    end;
    genTables => true : means that a default schema-based XMLType table will be created during registration.
    enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS : indicates that a repository resource conforming to the schema will be automatically stored in the default table.
    If the schema is not annotated, the name of the default table is system-generated but derived from the root element name :
    SQL> select table_name
      2  from user_xml_tables
      3  where xmlschema = 'my_schema.xsd'
      4  and element_name = 'employee';
    TABLE_NAME
    employee1121_TAB
    (warning : the name is case-sensitive)
    To annotate the schema and control the naming, modify the content to :
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
      <xs:element name="employee" xdb:defaultTable="EMPLOYEE_XML">
        <xs:complexType>
    Next step : create a resource, or just directly insert an XML document into the table.
    Example of creating a resource :
    declare
      res  boolean;
      doc  xmltype := xmltype(
    '<employee>
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>'
    begin
      res := dbms_xdb.CreateResource(
               abspath   => '/public/test.xml'
             , data      => doc
             , schemaurl => 'my_schema.xsd'
             , elem      => 'employee'
    end;
    The resource has to be schema-based so that the default storage mechanism is triggered.
    It could also be achieved if the document possesses an xsi:noNamespaceSchemaLocation attribute :
    SQL> declare
      2 
      3    res  boolean;
      4    doc  xmltype := xmltype(
      5  '<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6             xsi:noNamespaceSchemaLocation="my_schema.xsd">
      7    <details>
      8      <emp_id>1</emp_id>
      9      <emp_name>SMITH</emp_name>
    10      <emp_age>40</emp_age>
    11      <emp_dept>10</emp_dept>
    12    </details>
    13   </employee>'
    14   );
    15 
    16  begin
    17    res := dbms_xdb.CreateResource(
    18             abspath   => '/public/test.xml'
    19           , data      => doc
    20           );
    21  end;
    22  /
    PL/SQL procedure successfully completed
    SQL> set long 5000
    SQL> select * from "employee1121_TAB";
    SYS_NC_ROWINFO$
    <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceS
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>
    Then use XMLTABLE to shred the XML into relational format :
    SQL> select x.*
      2  from "employee1121_TAB" t
      3     , xmltable('/employee/details'
      4         passing t.object_value
      5         columns emp_id   integer      path 'emp_id'
      6               , emp_name varchar2(30) path 'emp_name'
      7       ) x
      8  ;
                                     EMP_ID EMP_NAME
                                          1 SMITH

  • Deleting Message Type name and namespace tag from XML payload

    Hi Gurus,
    Need help. My payload looks like this
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:MT_O_sss xmlns:ns1="http://sap.com/xi/tm">
    - <Job>
       <Field name="xxxx" value="" />
      <Field name="xxx" value="" />
      <Field name="xxx" value="" />
       </Job>
      </ns1:MT_O_sss>
    But The soap webservice is expecting it in
    <?xml version="1.0" encoding="utf-8" ?>
    - <Job>
       <Field name="xxxx" value="" />
      <Field name="xxx" value="" />
      <Field name="xxx" value="" />
       </Job>
    I have to remove the message type name and namespace tag.
    So how can I achieve this. I am sending this payload using a Receiver Soap Adapter. Please help. I am kind of stuck.

    hi,
    you have to simply add one module in your communication channel
    that is XMLAnonymizerBean
    you can refer below for help:
    Remove namespace prefix or change XML encoding with the XMLAnonymizerBean
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm
    hope it helps.
    regards,
    ujjwal kumar

  • How to parse and retrieve records from xml files into columns in Table

    Hi
    I attached the thing what i tried.
    Table to hold the XML COntent:
    create table xmlfile(xml_con sys.xmltype);
    Inserting Xml file content into the Above table:
    insert into xmlfile values(sys.xmltype.CreateXml('<Root><name>RAM</name><age>23</age></Root>'))
    SQL> select * from xmlfile;
    XML_CON
    <Root>
    <name>RAM</name>
    <age>23</age>
    </Root>
    SQL> select extractValue(xml_con, '/Root/name') content from xmlfile;
    CONTENT
    RAM
    This one works fine
    But if the file content is as below( contains MUltiple Records)
    insert into xmlfile values(sys.xmltype.CreateXml('<Root><Record><name>RAM</name><age>23</age></Record><Record><name>SAM</name><age>23</age></Record></Root>'))
    SQL> select extractValue(xml_con, '/Root/Record/name') content from xmlfile;
    ERROR at line 1:
    ORA-19025: EXTRACTVALUE returns value of only one node
    Can anyone help me 4 this issue-How to extract multiple records from the XML file inthis manner(from PL/SQL without using JAVA)
    OR
    If there is anyother way to do this please tell me?

    SQL> SELECT EXTRACTVALUE (COLUMN_VALUE, '//name') NAME,
           EXTRACTVALUE (COLUMN_VALUE, '//age') age
      FROM TABLE
              (XMLSEQUENCE
                  (EXTRACT
                      (XMLTYPE
                          ('<Root>
                              <Record>
                                <name>RAM</name>
                                <age>23</age>
                              </Record>
                              <Record>
                                <name>SAM</name>
                                <age>23</age>
                              </Record>
                            </Root>'
                       '/Root/Record'
    NAME       AGE      
    RAM        23       
    SAM        23       
    2 rows selected.

  • Randomnly load and animate videos from xml

    This is a lot to ask for Im sure but I want recreate a video
    thumbnail playlist similar to the one exsisting at the top of
    youtube.com page.
    I have an xml file with paths to the video.flv. I would like
    the thumbnails that launch the video to animate as it appear on
    stage (simple transition).
    I would also like these seven thumnail images to rotate out a
    new seven images about every 10 seconds.
    Where do I start? How can I create this effect using
    actionscript 3.0.
    Thanks in advance for your help

    This is a lot to ask for Im sure but I want recreate a video
    thumbnail playlist similar to the one exsisting at the top of
    youtube.com page.
    I have an xml file with paths to the video.flv. I would like
    the thumbnails that launch the video to animate as it appear on
    stage (simple transition).
    I would also like these seven thumnail images to rotate out a
    new seven images about every 10 seconds.
    Where do I start? How can I create this effect using
    actionscript 3.0.
    Thanks in advance for your help

  • Submit values and retrieve responses from xml api

    I use this code to submit to an api
    <cfhttp url="<api url>" method="GET" resolveurl="No" ></cfhttp>
    I get back

    <VerifySignatureResponse>
    −<VerifySignatureResult>
    <VerificationStatus>Success</VerificationStatus>
    </VerifySignatureResult>
    </VerifySignatureResponse>
    How do I retrieve the response? I ned to get back the Success for the VerificationStatus parameter

    this works for me
    <cfhttp url="<api url>" method="GET" resolveurl="No" ></cfhttp>
    <cfset mydoc = XmlParse(CFHTTP.FileContent)>
    <cfset pb = mydoc.variable1.XmlChildren>
    <cfset size = ArrayLen(pb)>
    <cfset myquery = QueryNew("variable1,variable2, variable3")>
    <cfset temp = QueryAddRow(myquery, #size#)>
    <cfset temp = QuerySetCell(myquery, "variable3", #mydoc.variable3.XmlText#)>
    <cfif #mydoc.variable1.variable2.variable3.XmlText# eq "Success">
    Action
    </cfif>
    You apparently didn't take the hint, Ian's or mine. What you've done may be correct, it unnecessarily involves too many functions. You could really do it more efficiently, like this
    <cfxml variable="xmlString"><cfoutput>#cfhttp.FileContent#</cfoutput></cfxml>
    <cfset statusArray=xmlSearch(xmlString,"//VerificationStatus")>
    <cfif statusArray[1].xmlText eq "Success">
    Action
    </cfif>

  • Business Intelligence and Analysis capabilities on XML content

    On page 99 of Oracle XML DB Basic Demonstration pdf doc it si said: "Even though Business Intelligence, such as rollup and cube, are not XML aware they are able to process XML content exposed through a relational view"
    is this true ? if so, how can i create a cube and/or
    dimension from XML content exposed through a relational view ?
    Unfortunately, Oracle 9i does not allow me to build materialzed views from XML content (Oracle objects)
    Thanks in advance,

    The intention of the documentation maybe that anything you can query using SQL, you can expose as XML. For instance, you could create an analytic workspace, expose it through views, query the views through SQL, and return the results as XML.

  • Business Intelligent and Analysis capabilities on XML content

    On page 99 of Oracle XML DB Basic Demonstration pdf doc it si said: "Even though Business Intelligence, such as rollup and cube, are not XML aware they are able to process XML content exposed through a relational view"
    is this true ? if so, how can i create a cube and/or
    dimension from XML content exposed through a relational view ?
    Unfortunately, Oracle 9i does not allow me to build materialzed views from XML content (Oracle objects)
    Thanks in advance,

    Thanks for your reply,
    The problem is that Oracle 9i, as far as i know, cannot build materialized views from XML data. The only thing i've been able to achieve are simple relational views and indexes.
    So, is it possible to build DW structures (cubes, dimensions,hierarchies, etc) using Oracle 9i from standard views instead of tables ? I believe not (or at least i haven't been able to)
    Thanks again

  • Fetch NOAA weather GIF file and display thru LabView

    I have an application that requires fetching real-time radar weather data from the NOAA weather site every 60 seconds and displaying it in LabView. I am using the Datasocket VI set, and have been able to fetch HTML (ASCII) data successfully and write it to a file using the Write Binary File VI, but when I go directly to fetching the .gif file, no data is fetched. I suspect that the Write Binary File VI is having trouble with the binary data in the .gif file itself. Occasionally I can get a few bytes of data, but it seems to stop on zeros. Has anyone been able to do something similar to this? The URL containing the .gif is at http://www.wrh.noaa.gov/radar/images/DS.p19r0/SI.kesx/latest.gif

    Hello Doug1234,
    I have attached an example that demonstrates how to do this in LabVIEW with Datasocket. It works by defining the web page as text and then reading the data into a string. Once read, we can save the string to file with a .gif extension.
    As mentioned by Evan, the internet toolkit will be the easiest way to perform this operation.
    Good luck with the development.
    Keep up to date on the latest PXI news at twitter.com/pxi
    Attachments:
    getpictdiagram.GIF ‏6 KB
    getpict.vi ‏33 KB

  • How to get the values of all elements and sub elements from  following xml

    how to get the values of all elements and sub elements from following xml...
    <?xml version="1.0" encoding="UTF-8" ?>
    <List_AML_Finacle xmlns="http://3i-infotech.com/Cust_AML_Finacle.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://3i-infotech.com/Cust_AML_Finacle.xsd List_AML_Finacle.xsd">
    <TransactionID>TransactionID</TransactionID>
    <Match>
    <Src_Matched_Field>Src_Matched_Field</Src_Matched_Field>
    <List_Matched_Field>
    <FSFM_Matches>
    <NUMBER>NUMBER</NUMBER>
    <TERROR>TERROR</TERROR>
    <TU>TU</TU>
    <NAMEU>NAMEU</NAMEU>
    <DESCRIPT>DESCRIPT</DESCRIPT>
    <KODCR>KODCR</KODCR>
    <KODCN>KODCN</KODCN>
    <AMR>AMR</AMR>
    <ADDRESS>ADDRESS</ADDRESS>
    <SD>SD</SD>
    <RG>RG</RG>
    <ND>ND</ND>
    <VD>VD</VD>
    <GR>GR</GR>
    <YR>YR</YR>
    <MR>MR</MR>
    <CB_DATE>CB_DATE</CB_DATE>
    <CE_DATE>CE_DATE</CE_DATE>
    <DIRECTOR>DIRECTOR</DIRECTOR>
    <FOUNDER>FOUNDER</FOUNDER>
    <TERRTYPE>TERRTYPE</TERRTYPE>
    </FSFM_Matches>
    <OfacMatchDetails>
    <UID>UID</UID>
    <TITLE>TITLE</TITLE>
    <SDNTYPE>SDNTYPE</SDNTYPE>
    <REMARKS>REMARKS</REMARKS>
    <ID_UID>ID_UID</ID_UID>
    <IDTYPE>IDTYPE</IDTYPE>
    <IDNUMBER>IDNUMBER</IDNUMBER>
    <IDCOUNTRY>IDCOUNTRY</IDCOUNTRY>
    <ISSUEDATE>ISSUEDATE</ISSUEDATE>
    <EXPIRATIONDATE>EXPIRATIONDATE</EXPIRATIONDATE>
    <ADDRESS1>ADDRESS1</ADDRESS1>
    <ADDRESS2>ADDRESS2</ADDRESS2>
    <ADDRESS3>ADDRESS3</ADDRESS3>
    <CITY>CITY</CITY>
    <STATEORPROVINCE>STATEORPROVINCE</STATEORPROVINCE>
    <POSTALCODE>POSTALCODE</POSTALCODE>
    <COUNTRY>COUNTRY</COUNTRY>
    </OfacMatchDetails>
    </List_Matched_Field>
    </Match>
    </List_AML_Finacle>

    avoid multi post
    http://forum.java.sun.com/thread.jspa?threadID=5249519

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

Maybe you are looking for

  • Operation on internal table

    Dear experts, I have 2 internal table , 1 inernal table have 4 fields and 10 records in that and the other hv 3 fields and 10 records in each field in that . My task is to transfer the 4th field and records of that of 1st table to 2nd field. Need som

  • Can't update iPhone 4S to iOS 5.1 through iTunes or phone itself

    I've tried updating my iPhone 4S to iOS 5.1 through iTunes(latest update) and all i get is the 'Contacting iPhone software update server' box and then nothing. It just stays on this box with nothing happening for as long you allow it.  I've also trie

  • What is the largest hard drive that can be put in a Macbook Pro 17 MA897

    I am looking to upgrade an existing Macbook Pro 17 model MA897 and am looking for the specifications as to the largest hard drive that can be installed and where is the best place to purchase drives.

  • Imac keeps renaming itself since yosemite update

    Since upgrading to Yosemite my iMac is renaming itself all the time. This is yet another issue with Apple updates. I have held back updating my iPhone 5s due to all the reported issues. come on Apple get your act together and debug before you release

  • How do i add app to launchpad?

    I have 2 versions of the same software and on Launchpad only one appears. Is there a way around this?