Built-in Like and Like Button - ios

I'm planning to use the Built-in Like for mobile users, and the standard Like Button for web users to "like" a webpage.
But is the Built-in Like feature has a connection to the Like Button (Social Plugin)?
From my observation:
On web version, after I clicked the standard Like Button, the Open Graph Object can track that like instantly
Calling fql?q=SELECT share_count, like_count, comment_count, total_count, click_count FROM link_stat WHERE url="http://websitelinkhere.com";
returns
{
"data": [
{
"share_count": 0,
"like_count": 1,
"comment_count": 0,
"total_count": 1,
"click_count": 0
}
]
}
But using the Built-in Like, the Open Graph Object cannot track that 'like' at all, the like_count and total_count are both 0.
And then here's the funny part:
By checking my og.likes using https://graph.facebook.com/userid/og.likes?access_token=myAccessToken
It returns TWO likes, 1 from the Like Button and 1 from the Built-in Like Action
{
"data": [
{
"id": "10151050736776633",
"from": {
//skipped
},
"start_time": "2012-08-24T07:10:52+0000",
"end_time": "2012-08-24T07:10:52+0000",
"publish_time": "2012-08-24T07:10:52+0000",
"application": {
//skipped
},
"data": {
//skipped
},
"type": "og.likes",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true
}
},
{
"id": "10151050736586633",
"from": {
//skipped
},
"start_time": "2012-08-24T07:10:42+0000",
"publish_time": "2012-08-24T07:10:42+0000",
"application": {
//skipped
},
"data": {
//skipped
},
"type": "og.likes",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true
}
}
]
}
And then by using action id returned by og.likes, I can delete both likes using
curl -X DELETE \
-F 'access_token=accessToken' \
https://graph.facebook.com/10151050736776633
and
curl -X DELETE \
-F 'access_token=accessToken' \
https://graph.facebook.com/10151050736586633
Is it because I haven't submit my application to Facebook for reviewing yet?
I'm expecting the Built-in Like and Like Button work together as ONE action, but not generating og.likes independently.
Thank you for your time.

Adding og:url and using the Open Graph Object ID directly fixes the problem.
curl -X POST \
-F 'access_token=accessTokenHere' \
-F 'object=UsingOpenGraphObjectIDHereDirectly' \
https://graph.facebook.com/useridhere/og.likes
May be related to Impossibile to publish built-in Like action on Open Graph Pages with Likes

Related

Analytics Widget in Azure devops server 2019 - looking for Rest Api and class libraby for analytics Widget

I'm working on creating set of widgets for dashboard via code using
REST api https://learn.microsoft.com/en-us/rest/api/azure/devops/dashboard/widgets/create?view=azure-devops-server-rest-5.0
So, I was able to create the widgets programatically but struggling while configuring the widget to point to certain team and details.
Example: creating Burndown widget using Analytics extention (https://marketplace.visualstudio.com/items?itemName=ms.vss-analytics&ssr=false#overview).
I was able to create widget with contributionId and details.
However, can't set the settings to do aggregation of story points over certain sprints.
Any help regarding this is appreciated.
Here is the json passed in Create request. Need help on "settings" part.
{
"id": "",
"eTag": "7",
"name": "Burndown",
"position": {
"row": 1,
"column": 4
},
"size": {
"rowSpan": 2,
"columnSpan": 3
},
"settings": "",
"settingsVersion": {
"major": 1,
"minor": 0,
"patch": 0
},
"artifactId": "",
"url": "urlvalue",
"_links": {
"self": {
"href": "urlvalue"
},
"group": {
"href": "urlvalue"
},
"dashboard": {
"href": "urlvalue"
}
},
"isEnabled": true,
"contentUri": null,
"contributionId": "ms.vss-dashboards-web.Microsoft.VisualStudioOnline.Dashboards.BurndownWidget",
"typeId": "Microsoft.VisualStudioOnline.Dashboards.BurndownWidget",
"configurationContributionId": "ms.vss-dashboards-web.Microsoft.VisualStudioOnline.Dashboards.BurndownWidget.Configuration",
"configurationContributionRelativeId": "Microsoft.VisualStudioOnline.Dashboards.BurndownWidget.Configuration",
"isNameConfigurable": true,
"loadingImageUrl": "urlvalue",
"lightboxOptions": {
"width": 900,
"height": 700,
"resizable": true
}
}
Below are two samples about the settings parts.
1.Set the certain date as the end date.
"settings":"{
\"teams\":[{
\"projectId\":\"projectId\",
\"teamId\":\"teamId\"
}],
\"aggregation\":{
\"identifier\":0,
\"settings\":\"\"
},
\"completedWorkEnabled\":false,
\"fieldFilters\":[],
\"stackByWorkItemTypeEnabled\":false,
\"burndownTrendlineEnabled\":true,
\"workItemTypeFilter\":{
\"identifier\":\"BacklogCategory\",
\"settings\":\"Microsoft.RequirementCategory\"
},
\"includeBugsForRequirementCategory\":false,
\"timePeriodConfiguration\":{
\"startDate\":\"2019-10-14\",
\"samplingConfiguration\":{
\"identifier\":0,
\"settings\":{
\"endDate\":\"2019-10-15\",
\"lastDayOfWeek\":5,
\"sampleInterval\":0
}
}
},
\"totalScopeTrendlineEnabled\":true
}",
2. Set the certain Iteration as the end date.
"settings":"{
\"teams\":[{
\"projectId\":\"projectId\",
\"teamId\":\"teamId\"
}],
\"aggregation\":{
\"identifier\":0,
\"settings\":\"\"
}
\"completedWorkEnabled\":false,
\"fieldFilters\":[],
\"stackByWorkItemTypeEnabled\":false,
\"burndownTrendlineEnabled\":true,
\"workItemTypeFilter\":{
\"identifier\":\"BacklogCategory\",
\"settings\":\"Microsoft.RequirementCategory\"
},
\"includeBugsForRequirementCategory\":false,
\"timePeriodConfiguration\":{
\"startDate\":\"2019-10-14\",
\"samplingConfiguration\":{
\"identifier\":1,
\"settings\":[
\"iterationId\"
]
}
},
\"totalScopeTrendlineEnabled\":true
}",

Finding text from the bounding box suggested by Google object detection ML

I am using Google Object Detection API for our custom model.
The dataset contains business cards so all text. We have deployed our model and it is working reasonably well when we test a business card using the visual interface.
However, to use it on the backend Nodejs server we are making use of REST APIs. API request looks like below:
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" https://automl.googleapis.com/v1beta1/projects/1023422831715/locations/us-central1/models/IOD9200669320764456960:predict -d #request.json
The data returned by REST response is like below:
{
"payload": [
{
"annotationSpecId": "5824016335306227712",
"imageObjectDetection": {
"boundingBox": {
"normalizedVertices": [
{
"x": 0.050029,
"y": 0.139873
},
{
"x": 0.230016,
"y": 0.251469
}
]
},
"score": 0.998103
},
"displayName": "first_name"
},
{
"annotationSpecId": "2224232858153648128",
"imageObjectDetection": {
"boundingBox": {
"normalizedVertices": [
{
"x": 0.0465549,
"y": 0.236178
},
{
"x": 0.462747,
"y": 0.30602
}
]
},
"score": 0.98034
},
"displayName": "job_title"
},
{
"annotationSpecId": "8910530192426926080",
"imageObjectDetection": {
"boundingBox": {
"normalizedVertices": [
{
"x": 0.053251,
"y": 0.410447
},
{
"x": 0.452525,
"y": 0.559461
}
]
},
"score": 0.904657
},
"displayName": "address"
}
]
}
The problem is that this in REST case only giving the bounding boxes with the score and label. However, it is not giving the . text under that bounding box.
So, how do we get the text under the above suggested bounding boxes?

Webhook input not available in scripting step?

I have an internal app that uses a webhook listener and some scripting to manipulate the input data. I'm posting this to it:
curl -X POST -d '{
"assignment_id": 12345,
"updated_custom_fields": [{
"name": "RNVIDAYEBB",
"value": "updated!"
},
{
"name": "QUFTXSIBYA",
"value": "and me too"
}
],
"custom_fields": [{
"id": 981,
"name": "RDEXDPVKRD",
"fields": [
{
"id": 4096,
"name": "RNVIDAYEBB",
"default": "EDJEAJICYW",
"required": true,
"value": "Blah"
},
{
"id": 4097,
"name": "QUFTXSIBYA",
"default": "",
"required": true,
"value": ""
}]
}]
}' "https://hooks.zapier.com/hooks/catch/......"
My script is as follows:
update_custom_fields_by_name_pre_write: function(bundle) {
var updatedFields = _.map(bundle.request.data.custom_fields, function(group) {
return _.map(group.fields, function(field) {
return _.extend(field, _.findWhere(bundle.request.data.updated_custom_fields, { name: field.name} ));
});
});
bundle.request.data = updatedFields;
return bundle.request;
}
I know that the merging logic is good, but it appears that the custom_fields and updated_custom_fields arrays are not present in the bundle.request.data object. Anyone know how to get access to them in the script?
It seems like you should be using update_custom_fields_by_name_catch_hook to capture the incoming static webhook data (instead of _pre_write). If you use that, you can capture the data within bundle.cleaned_request.custom_fields and bundle.cleaned_request.updated_custom_fields.

Retrieve only one object inside an array elasticsearch

I have an index named books which has reviews as an object which can handle arrays.
While retrieving data, in a particular case I only want the review having maximum rating.
"books" :{
"reviews": {
"properties": {
"rating": {
"type": "float"
},
"comments": {
"type": "string"
}
}
},
"author" : {
"type" : "string"
}
}
Many books can have many reviews each having some rating. For a particular use case I only want the result set to have the reviews having maximum rating. I need to build a search query for that kind of result.
POST books/_search
{
"size": 51,
"sort": [
{
"reviews.rating": {
"order": "asc",
"mode" : "min"
}
}
],
"fields": [
"reviews","author"]
}
By using script_fields one can build dynamic fields but not objects. Else I could have made a dynamic object reviews having one field as rating and another as comment.
script_fields can be used to build both dynamic fields and objects:
curl -XDELETE localhost:9200/test-idx
curl -XPUT localhost:9200/test-idx -d '{
"mappings": {
"books" :{
"reviews": {
"properties": {
"rating": {
"type": "float"
},
"comments": {
"type": "string"
}
}
},
"author" : {
"type" : "string"
}
}
}
}'
curl -XPOST "localhost:9200/test-idx/books?refresh=true" -d '{
"reviews": [{
"rating": 5.5,
"comments": "So-so"
}, {
"rating": 9.8,
"comments": "Awesome"
}, {
"rating": 1.2,
"comments": "Awful"
}],
"author": "Roversial, Cont"
}'
curl "localhost:9200/test-idx/books/_search?pretty" -d '{
"fields": ["author"],
"script_fields": {
"highest_review": {
"script": "max_rating = 0.0; max_review = null; for(review : _source[\"reviews\"]) { if (review.rating > max_rating) { max_review = review; max_rating = review.rating;}} max_review"
}
}
}'

How can elastic search find words in attachment file of couchdb?

Hi Please give me the indication./
I am using the elasticsearch 0.17.6 and couchdb 1.1.0
I have created two documents on couchdb:
Each document have the string fields: name, message. The first one is attached by a text file "test.txt" and the second one is not. The JSon code generated by CouchDB is like that:
{
"_id": "ID1",
"_rev": "6-e1ab4c5c65b98e9a0d91e5c8fc1629bb",
"name": "Document1",
"message": "Evaluate Elastic Search",
"_attachments": {
"test.txt": {
"content_type": "text/plain",
"revpos": 5,
"digest": "md5-REzvAVEZoSV69SLI/vaflQ==",
"length": 86,
"stub": true
}
}
}
{
"_id": "ID2",
"_rev": "2-72142ec18248cedb4dba67305d136aa8",
"name": "Document2",
"message": "test Elastic Search"
}
These two documents are in a database called my_test_couch_db
I have use Elasticsearch (ES) to index these documents using plugins: river and mapper-attachments. For each given text, I expect that ES can find, not only corresponding text in document's fields, but also in the attachment *.txt file. But it is impossible. I try many ways:I have created index manually, mapping (automatically and manually), configure river, etc. but ES can only find words in document's fields, it cannot find the ones in *.txt attachment files. I follow the indication of site http://www.elasticsearch.org but it doesnot work, either.
Thanks for your answers.
Here is my commands:
curl -X PUT "localhost:9200/test_idx_1"
curl -X PUT "localhost:9200/test_idx_1/test_mapping_1/_mapping" -d '{
"test_mapping_1": {
"properties": {
"_attachments": {
"type": "attachment",
"index": "yes"
}
}
}
}'
curl -XPUT 'http://localhost:9200/_river/test_river_1/_meta' -d '{
"type": "couchdb",
"couchdb": {
"host": "localhost",
"port": 5984,
"db": "my_test_couch_db",
"filter": null
},
"index": {
"index": "test_idx_1",
"type": "test_mapping_1"
}
}'
then, I try to search
curl -XPOST 'http://localhost:9200/my_test_couch_db/my_test_couch_db/_search'
(two documents are find very well )
curl -XPOST 'http://localhost:9200/my_test_couch_db/my_test_couch_db/_search' -d '{
"query": {
"text": {
"_all": "test"
}
}
}'
Here is the output
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.081366636,
"hits": [
{
"_index": "my_test_couch_db",
"_type": "my_test_couch_db",
"_id": "ID2",
"_score": 0.081366636,
"_source": {
"message": "test Elastic Search",
"_rev": "2-72142ec18248cedb4dba67305d136aa8",
"_id": "ID2",
"name": "Document2"
}
}
]
}
}
As you see, the ES can only find the word "test" in the message field, they cannot find this word in the *.text attachment files.
I try the other queries:
curl -XPOST 'http://localhost:9200/my_test_couch_db/my_test_couch_db/_search' -d '{
"query": {
"text": {
"_attachments": "test"
}
}
}'
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
curl -XPOST 'http://localhost:9200/my_test_couch_db/my_test_couch_db/_search' -d '{
"query": {
"text": {
"_attachments.fields.file": "test"
}
}
}'
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
The output is nothing. I try other mappings but it doesn't work, either.
Why is that and how to solve this problem?
Attachment are not yet loaded by couchDb river.
I have updated it but still waiting for users that it works fine.
See https://github.com/dadoonet/elasticsearch-river-couchdb/tree/attachments
You can try it here : https://github.com/downloads/dadoonet/elasticsearch-river-couchdb/elasticsearch-river-couchdb-1.2.0-SNAPSHOT.zip
If it works fine for you, I can create the pull request.

Resources