|
Aim
In this example, we poll a Yahoo! Weather Web page and extract the temperature reported in Houston, TX in order to build a temperature graph in BMC Portal.
Procedure
| 1. | Add a new “Web Request (Simple, HTTP GET)” class: |
| ▪ | Leave the “Authenticate As” credential fields empty as we don’t need to authenticate to access the Yahoo! Weather Web site |
| ▪ | Enter the proxy settings applicable to your environment (“Proxy Credentials”, “Proxy Address” and “Proxy Port”) |
| 2. | Add a new “Web Request” instance: |
| ▪ | URL: http://weather.yahoo.com/forecast/USTX0617_f.html |
| ▪ | Return Output Options: Only the Content Text |
| 3. | Add a new Numeric Value Extraction: |
| ▪ | Label: “Feels Like Temperature (°F)” |
| ▪ | Extract numeric values from: “Lines matching the regular expression below” |
| ▪ | Regular expression: Feels Like: |
| ▪ | Numeric Value Located: After the String |
| ▪ | String / Column Number: Feels Like: |
| ▪ | If Several Numeric Values Are Found: Keep the Last Value Found |
Result
We get a data and graphs in the Portal representing the temperature “felt” in Houston, Texas! We could also add another graph with the wind speed, the humidity percentage, etc.
|