Skip to content

Instantly share code, notes, and snippets.

@jacqui
Created August 12, 2014 21:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacqui/1336a99d2b534591d2ea to your computer and use it in GitHub Desktop.
Save jacqui/1336a99d2b534591d2ea to your computer and use it in GitHub Desktop.
streamtools pattern for the UK food ratings endpoint at http://ratings.food.gov.uk/OpenDataFiles/FHRS531en-GB.xml
{
"Blocks": [
{
"Id": "24",
"Type": "bang",
"Rule": null,
"Position": {
"X": 309,
"Y": 79
}
},
{
"Id": "25",
"Type": "webRequest",
"Rule": {
"BodyPath": ".",
"Headers": {},
"Method": "GET",
"Url": "http://ratings.food.gov.uk/OpenDataFiles/FHRS531en-GB.xml",
"UrlPath": ""
},
"Position": {
"X": 287,
"Y": 154
}
},
{
"Id": "26",
"Type": "parsexml",
"Rule": {
"Path": ".body"
},
"Position": {
"X": 306,
"Y": 247
}
},
{
"Id": "29",
"Type": "unpack",
"Rule": {
"Path": ".FHRSEstablishment.EstablishmentCollection.EstablishmentDetail"
},
"Position": {
"X": 297,
"Y": 340
}
},
{
"Id": "31",
"Type": "cache",
"Rule": {
"KeyPath": ".BusinessName",
"TimeToLive": "10m",
"ValuePath": ".RatingValue"
},
"Position": {
"X": 348,
"Y": 467
}
}
],
"Connections": [
{
"Id": "27",
"FromId": "24",
"ToId": "25",
"ToRoute": "in"
},
{
"Id": "28",
"FromId": "25",
"ToId": "26",
"ToRoute": "in"
},
{
"Id": "30",
"FromId": "26",
"ToId": "29",
"ToRoute": "in"
},
{
"Id": "32",
"FromId": "29",
"ToId": "31",
"ToRoute": "in"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment