AmCharts: Clustered bar chart with sub-categories - chart.js

I try to realize a clustered bar chart with sub-categories in amcharts (two levels in my x-axis). I couldn't find a way to do it.
Does anyone know how to do it ?

The tricky part is the parent category name_fr on the graph. To do that, we need to use Guide(https://docs.amcharts.com/3/javascriptcharts/Guide) within the CategoryAxis.
But in order to use Guide, each category needs an unique identifier as each guide (in your case, it's each name) needs a starting point field (called Category) and an ending point field (called ToCategory).
Create ID for each data point
Here I just concat the name and date field. If your data has an ID field, you can use that too.
let data = [
{
"category": "Allemagne-1/3/2005",
"name_fr": "Allemagne",
"date": "1/3/2005",
"Décile 1": 11.91166848,
"Décile 5": 6.663209907,
"Décile 9": 3.912389412
},
{
"category": "Allemagne-12/18/2017",
"name_fr": "Allemagne",
"date": "12/18/2017",
"Décile 1": 12.08203299,
"Décile 5": 6.181569343,
"Décile 9": 3.380401158
},
{
"category": "Espagne-1/3/2005",
"name_fr": "Espagne",
"date": "1/3/2005",
"Décile 1": 18.16145046,
"Décile 5": 8.049555152,
"Décile 9": 4.02786022
},
{
"category": "Espagne-12/18/2017",
"name_fr": "Espagne",
"date": "12/18/2017",
"Décile 1": 22.27695636,
"Décile 5": 8.698725621,
"Décile 9": 4.224440949
},
{
"category": "France-1/3/2005",
"name_fr": "France",
"date": "1/3/2005",
"Décile 1": 11.29143493,
"Décile 5": 6.365859777,
"Décile 9": 3.476250813
},
{
"category": "France-12/18/2017",
"name_fr": "France",
"date": "12/18/2017",
"Décile 1": 11.46405229,
"Décile 5": 6.355936042,
"Décile 9": 3.441408741
},
{
"category": "Italie-1/3/2005",
"name_fr": "Italie",
"date": "1/3/2005",
"Décile 1": 16.86187094,
"Décile 5": 7.798630041,
"Décile 9": 4.017535647
},
{
"category": "Italie-12/18/2017",
"name_fr": "Italie",
"date": "12/18/2017",
"Décile 1": 21.92640815,
"Décile 5": 9.365977512,
"Décile 9": 4.893619709
},
{
"category": "Royaume-Uni-1/3/2005",
"name_fr": "Royaume-Uni",
"date": "1/3/2005",
"Décile 1": 13.55694413,
"Décile 5": 6.402068504,
"Décile 9": 3.057193284
},
{
"category": "Royaume-Uni-12/19/2016",
"name_fr": "Royaume-Uni",
"date": "12/19/2016",
"Décile 1": 13.19564289,
"Décile 5": 6.639341135,
"Décile 9": 3.359725023
}
];
Create Guide array from data
Before you plug the data into AmChart, if you don't want to hard code the Guide array, you can generate that from the data first.
The idea here is to group by the data by name_fr, and then grab the first item category as the Category of the guide, and the last item category as the ToCategory of the guide.
You can write your own JavaScript function to do group by, but here I am lazy and just want to use a library called underscore.js (https://underscorejs.org) to do so.
let byName = _.groupBy(data, "name_fr");
let guides = _.map(byName, function(items, key) {
return {
"category": _.first(items).category,
"toCategory": _.last(items).category,
"lineAlpha": 0,
"expand": true,
"label": key,
"labelRotation": 0,
"tickLength": 80
};
});
Make the graph
Then you can feed the data along with the guides into AmChart to make the graph.
fiddle: http://jsfiddle.net/davidliang2008/kp16Lv4a/

Related

How do I use aggregates in grouped marks?

I'm trying to use the min and max aggregates of a quantitative column (Total bombers) grouped by another column (Country) in a rule mark of my visual. I want the rule y property to start at the minimum value of Total bombers and the rule y2 property to end at the maximum value of total bombers, but I can't seem to find the right syntax for the min and max aggregates of the rule mark. I can get the result I'm looking for by not grouping the marks but I would like to implement it for grouped marks so I can re-use it more easily.
Spec for grouped version I'm trying to use min and max aggregates in:
https://vega.github.io/editor/#/url/vega/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykSArJQBWENgDsQAGhAATONABONHJnaT0AQQAETJBBpRtAGxri422EkWZtcAB5IEOY3ErSQAdxqz6aAQAMATLwNGRYaABMQTI4SLKyZmT+MgZk4kjGEGgA2gC6MrJImCioOaAZCHBoIExsCExwitkyDIrGNVi4+ES0EJjUdIxMDBBNUBKYcOIDEwgkssRsbIryigQCTADMAQCcuwDssgAcBwHHCUgHx1tMTJFMuwKykXC7cABmWwAsBIpIngIACF6o1FABSSICaIAcSQOEoUAgxA8HxWyEwaFAmA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kASaG8mTcq8kaZAOnxbvNPmv0yrIhdglohVmW1eHicwiwHW9YN+3Oq26tJ9QQ7x4d87-dADW0Hux6npTFMgA
Spec for non-grouped version that achieves what I want to do:
https://vega.github.io/editor/#/url/vega/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykSArJQBWENgDsQAGhAATONABONHJnaT0AQQAETJBBpRtAGxri422EkWZtcAB5IEOY3ErSQAdxqz6aAQAMATLwNGRYaABMQTI4SLKyZmT+MgZk4kjGEGgA2gC6MrJImCioOaAZCHBoIExsCExwitkyDIrGNVi4+ES0EJjUdIxMDBBNUBKYcOIDEwgkssRsbIryigQCTADMAQCcuwDssgAcBwHHCUgHx1tMTJFMuwKykXC7cABmWwAsBIpIngIACF6o1FABSSICaIAcSQOEoUAgxA8HxWyEwaFAmAAnjhqugkSjYtYxliQAAVNglYy6UFNbLocQMBpNDwATTg1hqzNZihAAF8BTJMP9xBA0YoELlsXiCSBJQgGMYUDJ9DUilMPA4cPz0GoqgAKTVwA1wY3FFmUTnWKTaACMdvtAEpnYKpLL8TUPjRjFN+TIdXq5JaENauYptAAeAC8Dt2xwC7s98pwNCWmJkZEUbAYOCYONyIBt-IKCpocGMshqAGFczNFIWZMRMgx5VSaXS+dlhSnvejlaqQOr0CbtfZdTUzRaptPNVaS06na7kyBcV70IrBx4R5TqZku2CWiAgxrQzkAOQAZTYxArtgAquJ1Be8toANTaecIS9PuhwWRtCvEopggV9BTyXsQEqeU4FIGZjxbYw20ZcoQAAOSceUhxLNB7SeSIZAAEQUKBlFUdQagAGRWRBtBUCAWVXTCqhqJgOQjPDdgANmCEASKUFQ1AkGoAEk8BZExaOlAUy1FJBxUVGU1zlfspW3NVGRDLVAwnYM52KU0aCNb9w1tB1lzdWTZNSKBMgUZSYJqewPHXeUzQ8MUyHlbxfBgDxZHqJAzHJTVSlqelmlRCsqzPLUhQ9aCsJqJsVI3EBTHMbkZC8+VQnCTNoMMAlRTbG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FOSenWSAA
Any help much appreciated!
What you're trying to do isn't logically possible. You have faceted on country. That means each country gets a line (working), a symbol (working) but how would it get a rule where the start point is one country and the end point is the other. One group does not know anything about the other group so you couldn't have a rule spanning the two countries.
If you want to keep your facet, you can do the following:
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "A basic line chart example.",
"width": 500,
"height": 200,
"padding": 5,
"signals": [],
"data": [
{
"name": "bombers",
"url": "https://gist.githubusercontent.com/vdvoorder/5b30997d8708dda783bb2b95d2e9ef34/raw/Bomber%2520Gap.csv",
"format": {
"type": "csv",
"parse": {"Total bombers": "number", "Year": "number"}
},
"transform": [
{
"type": "formula",
"as": "date",
"expr": "time(datetime(datum.Year, 1, 1))"
},
{"type": "filter", "expr": "datum.Year <= 1980"}
]
},
{
"name": "bombers2",
"source": "bombers",
"transform": [
{
"type": "pivot",
"field": "Country",
"value": "Total bombers",
"groupby": ["date"]
}
]
}
],
"scales": [
{
"name": "x",
"type": "time",
"range": "width",
"domain": {"data": "bombers", "field": "date"}
},
{
"name": "y",
"type": "linear",
"range": "height",
"nice": true,
"zero": true,
"domain": {"data": "bombers", "field": "Total bombers"}
},
{
"name": "color",
"type": "ordinal",
"range": "category",
"domain": {"data": "bombers", "field": "Country"}
}
],
"axes": [
{"orient": "bottom", "scale": "x"},
{"orient": "left", "scale": "y"}
],
"marks": [
{
"type": "group",
"from": {
"facet": {"name": "series", "data": "bombers", "groupby": "Country"}
},
"marks": [
{
"description": "Line for evolution of total bombers by country",
"type": "line",
"from": {"data": "series"},
"encode": {
"enter": {
"x": {"scale": "x", "field": "date"},
"y": {"scale": "y", "field": "Total bombers"},
"stroke": {"scale": "color", "field": "Country"},
"strokeCap": {"value": "round"},
"strokeWidth": {"value": 3},
"strokeOpacity": {"value": 0.5}
}
}
},
{
"description": "Points for total bombers by country",
"type": "symbol",
"from": {"data": "series"},
"encode": {
"enter": {
"x": {"scale": "x", "field": "date"},
"y": {"scale": "y", "field": "Total bombers"},
"size": {"value": 50},
"fill": {"scale": "color", "field": "Country"},
"strokeWidth": {"value": 20},
"stroke": {"value": "lightskyblue"}
},
"update": {
"fillOpacity": {"value": 1},
"strokeOpacity": {"value": 0}
},
"hover": {"strokeOpacity": {"value": 1}}
}
}
]
},
{
"description": "Rulers between country total bomber numbers",
"type": "rule",
"from": {"data": "bombers2"},
"encode": {
"update": {
"x": {"scale": "x", "field": "date"},
"y": {"scale": "y", "field": "Soviet Union"},
"y2": {"scale": "y", "field": "United States"},
"stroke": {"value": "lightskyblue"},
"strokeWidth": {"value": 3},
"strokeOpacity": {"value": 0.5}
}
}
}
]
}

How to use the json output from aws Amazon Transcribe Medical

the output is made of json with the whole text and each speaker segments like so:
"speaker_labels": {
"speakers": 2,
"segments": [
{
"start_time": "0.94",
"speaker_label": "spk_0",
"end_time": "3.065",
"items": [
{
"start_time": "1.01",
"speaker_label": "spk_0",
"end_time": "1.22"
},
.
.
.
and then the each word and its timestamp
"items": [
{
"start_time": "1.01",
"end_time": "1.22",
"alternatives": [{ "confidence": "1.0", "content": "word" }],
"type": "pronunciation"
},
{
"start_time": "1.22",
"end_time": "1.81",
"alternatives": [{ "confidence": "1.0", "content": "word" }],
"type": "pronunciation"
},
{
"alternatives": [{ "confidence": "0.0", "content": "another word" }],
"type": "punctuation"
},
.
.
.
and i need each speaker's words how am i suppose to get that data without doing alot of logic with the start end time of the words and all the start end of the speakers.
the result i expect:
spk_0 : words words words
spk_1 : words words more words

"Buffalo" query fails to return "Buffalo Exchange" from /discover endpoint

NOTE: this question is specifically for support staff of the HERE Developer API because they ask freemium users to post support questions on Stack Overflow rather than trying to contact them directly. If you're not a member of their staff and you're unable to help or if the question is unclear to you, don't worry about it. :)
For some reason the /discover endpoint doesn't return the "Buffalo Exchange" place that's at my specified coordinates, but only returns 2 localities that are much further away. This is the query that I'm using: https://discover.search.hereapi.com/v1/discover?at=34.003975%2C-118.484823&q=Buffalo&limit=20&apiKey=<insert API KEY>. These are the results I currently receive:
{
"items": [
{
"title": "Buffalo, NY, United States",
"id": "here:cm:namedplace:21018816",
"resultType": "locality",
"localityType": "city",
"address": {
"label": "Buffalo, NY, United States",
"countryCode": "USA",
"countryName": "United States",
"stateCode": "NY",
"state": "New York",
"county": "Erie",
"city": "Buffalo",
"postalCode": "14202"
},
"position": {
"lat": 42.88544,
"lng": -78.87846
},
"distance": 3551940,
"mapView": {
"west": -78.9168,
"south": 42.82603,
"east": -78.79492,
"north": 42.96651
}
},
{
"title": "Buffalo City, Eastern Cape, South Africa",
"id": "here:cm:namedplace:23402337",
"resultType": "locality",
"localityType": "city",
"address": {
"label": "Buffalo City, Eastern Cape, South Africa",
"countryCode": "ZAF",
"countryName": "South Africa",
"state": "Eastern Cape",
"county": "Buffalo City",
"city": "Buffalo City",
"postalCode": "5201"
},
"position": {
"lat": -33.0148,
"lng": 27.9038
},
"distance": 16910944,
"mapView": {
"west": 27.15745,
"south": -33.28749,
"east": 28.08053,
"north": -32.674
}
}
]
}
You can see that for both places the resultType is "locality".
Now compare that to the first result of a similar query that searches for the term "Exchange" instead of "Buffalo". All other query params are the same. This is the URL: https://discover.search.hereapi.com/v1/discover?at=34.003975%2C-118.484823&q=Exchange&limit=20&apiKey=<insert API KEY>, and this is how the results begin (not shown fully because there are many results):
{
"items": [
{
"title": "Buffalo Exchange",
"id": "here:pds:place:8403fv6k-b15f290ec4f409deea99318f7388bbd6",
"resultType": "place",
"address": {
"label": "Buffalo Exchange, 2449 Main St, Santa Monica, CA 90405, United States",
"countryCode": "USA",
"countryName": "United States",
"stateCode": "CA",
"state": "California",
"county": "Los Angeles",
"city": "Santa Monica",
"district": "City of Santa Monica",
"street": "Main St",
"postalCode": "90405",
"houseNumber": "2449"
},
"position": {
"lat": 34.00342,
"lng": -118.48483
},
"access": [
{
"lat": 34.00331,
"lng": -118.48493
}
],
"distance": 61,
"categories": [
{
"id": "600-6800-0090",
"name": "Women's Apparel",
"primary": true
},
{
"id": "600-6800-0000",
"name": "Clothing & Accessories"
},
{
"id": "600-6800-0089",
"name": "Men's Apparel"
},
{
"id": "600-6900-0251",
"name": "Used/Second-hand Merchandise Stores"
}
],
"references": [
{
"supplier": {
"id": "core"
},
"id": "1211447153"
},
{
"supplier": {
"id": "yelp"
},
"id": "5PzeN6hGLBPmJpCJ2ZmfCQ"
}
],
"contacts": [
{
"phone": [
{
"value": "+13103147300"
},
{
"value": "+13103924301",
"categories": [
{
"id": "600-6800-0000"
}
]
}
],
"fax": [
{
"value": "(520) 622-7015",
"categories": [
{
"id": "600-6800-0000"
}
]
}
],
"www": [
{
"value": "http://www.buffaloexchange.com",
"categories": [
{
"id": "600-6800-0000"
},
{
"id": "600-6900-0251"
}
]
}
],
"email": [
{
"value": "contact#bufex.com",
"categories": [
{
"id": "600-6800-0000"
}
]
}
]
}
],
"openingHours": [
{
"categories": [
{
"id": "600-6800-0000"
}
],
"text": [
"Mon-Sun: 11:00 - 20:00"
],
"isOpen": false,
"structured": [
{
"start": "T110000",
"duration": "PT09H00M",
"recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU"
}
]
},
{
"categories": [
{
"id": "600-6800-0090"
},
{
"id": "600-6900-0251"
}
],
"text": [
"Mon-Sat: 11:00 - 20:00",
"Sun: 11:00 - 19:00"
],
"isOpen": false,
"structured": [
{
"start": "T110000",
"duration": "PT09H00M",
"recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA"
},
{
"start": "T110000",
"duration": "PT08H00M",
"recurrence": "FREQ:DAILY;BYDAY:SU"
}
]
}
]
},
...
}
You can see that the first result has the name "Buffalo Exchange" and the "resultType" is "place". This is the result I want. The question is why does this result fail to show up when the search query is "Buffalo"? Of course with the /discover endpoint I can't specify the category IDs I want to search, that's only available via the /browse endpoint. But with the /browse endpoint I can't specify a specific search term like "Buffalo" or "Exchange".
Update: this problem also happens with the "Bison" query in Alberta, Canada. The query for this is https://discover.search.hereapi.com/v1/discover?at=56.745531%2C-111.351341&q=Exchange&limit=20&apiKey=<insert API KEY>. This query yields only 10 results, and only 4 of them have resultType of "place".
We recommend application developers to use both Autosuggest and Discover, you get the nearby Buffalo Exchange because Autosuggest considers that the query is incomplete. Note that Discover considers the query to be complete.
As HERE Geocoding and Search is meant to provide relevant responses to user queries.
Geocoding Search Api (Autosuggest): https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-autosuggest-brief.html
Geocoding Search Api (Discover): https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-discover-brief.html
The above-mentioned user guide can help modify the query for accurate results.

How to Implement Partial Auth on Authorize.net API [duplicate]

Okay I am setting up Partial Payments via the Authorize.net API in order to enable multiple cards to be used to cover a single balance/charge.
I'm assuming thier Partial Auth feature covers my use case, but in testing, there is an issue I can show you using the API live console here: https://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card
Go to the link above and authorize partial payments with the request I edited below and you will notice when you press submit you get a splitTenderId:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "5KP3u95bQpv",
"transactionKey": "346HZ32z3fP4hTG2"
},
"refId": "123456",
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "462.25",
"payment": {
"creditCard": {
"cardNumber": "5424000000000015",
"expirationDate": "2020-12",
"cardCode": "999"
}
},
"lineItems": {
"lineItem": {
"itemId": "1",
"name": "vase",
"description": "Cannes logo",
"quantity": "18",
"unitPrice": "45.00"
}
},
"tax": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"duty": {
"amount": "8.55",
"name": "duty name",
"description": "duty description"
},
"shipping": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"poNumber": "456654",
"customer": {
"id": "99999456654"
},
"billTo": {
"firstName": "Ellen",
"lastName": "Johnson",
"company": "Souveniropolis",
"address": "14 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"shipTo": {
"firstName": "China",
"lastName": "Bayles",
"company": "Thyme for Tea",
"address": "12 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"customerIP": "192.168.1.1",
"transactionSettings": {
"setting": [
{
"settingName": "emailCustomer",
"settingValue": "true"
}, {
"settingName": "allowPartialAuth",
"settingValue": "true"
},
]
},
"userFields": {
"userField": [
{
"name": "MerchantDefinedFieldName1",
"value": "MerchantDefinedFieldValue1"
},
{
"name": "favorite_color",
"value": "blue"
}
]
}
}
}
}
This is only successful because the amount is 462.25 as the docs say to use for testing, if I use any other (real) amount the splitTenderId is not there.
Here is a new example request, you can post this again on the link above:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "5KP3u95bQpv",
"transactionKey": "346HZ32z3fP4hTG2"
},
"refId": "123456",
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "462",
"payment": {
"creditCard": {
"cardNumber": "5424000000000015",
"expirationDate": "2020-12",
"cardCode": "999"
}
},
"lineItems": {
"lineItem": {
"itemId": "1",
"name": "vase",
"description": "Cannes logo",
"quantity": "18",
"unitPrice": "45.00"
}
},
"tax": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"duty": {
"amount": "8.55",
"name": "duty name",
"description": "duty description"
},
"shipping": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"poNumber": "456654",
"customer": {
"id": "99999456654"
},
"billTo": {
"firstName": "Ellen",
"lastName": "Johnson",
"company": "Souveniropolis",
"address": "14 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"shipTo": {
"firstName": "China",
"lastName": "Bayles",
"company": "Thyme for Tea",
"address": "12 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"customerIP": "192.168.1.1",
"transactionSettings": {
"setting": [
{
"settingName": "emailCustomer",
"settingValue": "true"
}, {
"settingName": "allowPartialAuth",
"settingValue": "true"
},
]
},
"userFields": {
"userField": [
{
"name": "MerchantDefinedFieldName1",
"value": "MerchantDefinedFieldValue1"
},
{
"name": "favorite_color",
"value": "blue"
}
]
}
}
}
}
And with the 462 amount entered this is no longer a partial auth payment and I no longer get a splitTenderId.
Can someone please help me figure out what is going on?

Why application posts on my wall marked as links?

My application creates posts on user's wall, but it's marked as link.
I see that other applications doing same thing but for some reason facebook don't mark their posts as links. Tried to find the difference between them and me in graph api explorer, and the only difference is status_type attribute (this is not even documented). Mine set to "shared_story" and in other applications is "app_created_story". Tried to set it manualy but facebook still use shared_story even if I set it to app_created_story
Data from graph api explorer (first is my application)
[{
"id": "100001302536317_168939309896943",
"from": {
"name": "Андрей Реаскович",
"id": "100001302536317"
},
"story": "Андрей Реаскович shared a link.",
"story_tags": {
"0": [
{
"id": "100001302536317",
"name": "Андрей Реаскович",
"offset": 0,
"length": 16,
"type": "user"
}
]
},
"picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQBcrRQnipKHB6g6&w=90&h=90&url=http%3A%2F%2Fstatic.jackpotrush.com%2Fimages%2Fviral%2Fgames%2Fjoker_jester.png",
"link": "http://apps.facebook.com/jackrush/?ref=bonus-game",
"name": "I Won Big on a Bonus Round at Jackpot Rush!",
"caption": " ",
"description": "I Just Won 200 Coins at a Jackpot Rush Bonus Round and it Feels Amazing!",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/100001302536317/posts/168939309896943"
},
{
"name": "Like",
"link": "http://www.facebook.com/100001302536317/posts/168939309896943"
}
],
"privacy": {
"description": "Only Me",
"value": "SELF"
},
"type": "link",
"status_type": "shared_story",
"application": {
"name": "Jackrush Development",
"namespace": "jackrush",
"id": "434595133235542"
},
"created_time": "2012-11-12T08:48:18+0000",
"updated_time": "2012-11-12T08:48:18+0000",
"comments": {
"count": 0
}
},
{
"id": "100001302536317_420171444702936",
"from": {
"name": "Андрей Реаскович",
"id": "100001302536317"
},
"picture": "http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=242829452408559&v=1&size=z&cksum=cd0fa7a15202d05700bf1464fd989d42&src=http%3A%2F%2Fc.cdn.blueshellgames.com%2Fs%2F%3Aac05b878%2Fmonte%2Fi%2Ffeed_story_image-logo_black.png",
"link": "http://apps.facebook.com/luckyslotsgame/?action=shareLevelUpReward&posterID=fb%3A100001302536317&k_utag=df3f4636aabab65e&levelUpToken=6553%3AsVFCJmW43zW_Nni9vBB9xg%3D%3D&level=4&refID=fb%3A100001302536317&utm_medium=viral&utm_source=levelUp",
"name": "First 5 Clickers get 150 Free Coins!",
"caption": "Андрей just reached level 4 and is giving away 150 Free Coins to celebrate!",
"description": "Play the best slots on Facebook! Get free chips daily! Unlock new slot machines and new bonus games! Don't miss out, play now!",
"icon": "http://photos-d.ak.fbcdn.net/photos-ak-snc7/v85006/51/242829452408559/app_2_242829452408559_9481.gif",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/100001302536317/posts/420171444702936"
},
{
"name": "Like",
"link": "http://www.facebook.com/100001302536317/posts/420171444702936"
},
{
"name": "Claim BONUS Coins",
"link": "http://apps.facebook.com/luckyslotsgame/?action=shareLevelUpReward&posterID=fb%3A100001302536317&k_utag=df3f4636aabab65e&levelUpToken=6553%3AsVFCJmW43zW_Nni9vBB9xg%3D%3D&level=4&refID=fb%3A100001302536317&utm_medium=viral&utm_source=levelUp"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE"
},
"type": "link",
"status_type": "app_created_story",
"application": {
"name": "Lucky Slots",
"namespace": "luckyslotsgame",
"id": "242829452408559"
},
"created_time": "2012-11-12T08:13:25+0000",
"updated_time": "2012-11-12T08:13:25+0000",
"comments": {
"count": 0
}
}]