i can not see good documentation about Facebook Places, please tell me if you know something about it.
https://graph.facebook.com/search?q=coffee&type=place¢er=37.76,122.427&distance=1000
1) In above url what is the unit of distance? (Meter, KM, Miles or something else?)
2) What is the actual meaning of distance.. is it search result comes within this range or it starts search within this range and goes beyond for more results?
3) How can we restrict search result to any specific city or country?
4) What we can do more with this API?
According to https://developers.facebook.com/docs/android/scrumptious/show-nearby-places/ the unit of distance is meters.
edit - FB keeps moving the information around their documentation, so it may not be there when you look. Search for 'places meters' and you should find the citation: https://developers.facebook.com/search/?q=places%20meters
The search excludes results outside of a circle with the radius of your specific distance.
Use the location field of the places returned by your search to filter out any unwanted places. For example, if you had these results, you could use the city filter to include only Brooklyn (or New York).
[{
"name": "Bembe",
"location": {
"street": "81 S 6th St.",
"city": "Brooklyn",
"state": "NY",
"country": "United States",
"zip": "11222",
"latitude": 40.710978587859,
"longitude": -73.965404723282
},
"id": "146207358735488"
},
{
"name": "Manhattan Bridge Orthodontics",
"location": {
"street": "145 Canal St, 2nd Floor",
"city": "New York",
"state": "NY",
"country": "United States",
"zip": "10002-5033",
"latitude": 40.709716414644,
"longitude": -73.988593034059
},
"id": "121071754616533"
}]
4.Limited only by your imagination.
Related
I am trying to accomplish pulling all of the data that populates from this API CALL made within my CRM Podio...
The API call response is the following:
{
"status": {
"version": "1.0.0",
"code": 0,
"msg": "SuccessWithResult",
"total": 1,
"page": 1,
"pagesize": 10,
"transactionID": "ba31a62303e76d49b2063e94e2972bc6"
},
"property": [
{
"identifier": {
"Id": 34476108,
"fips": "48201",
"apn": "1288930010042",
"attomId": 34476108
},
"lot": {
"lotnum": "42",
"lotsize1": 0.2735078,
"lotsize2": 11914,
"poolind": "YES"
},
"area": {
"blockNum": "1",
"loctype": "VIEW - NONE",
"countrysecsubd": "Harris",
"countyuse1": "1001 ",
"muncode": "HA",
"munname": "HARRIS",
"subdname": "BLACKHORSE RANCH SOUTH SEC 6",
"taxcodearea": "40"
"legal1": "BLACK HORSE RANCE LOT 14 BLOCK 12 USA"
etc.
I have tried the following code to pull just the legal description but it returns the entire API response in the comments of my crm. I am trying to get all data points listed individually.
preg_match_gf("/legal1\.\:\s\/(.*)/ism",[(Variable) PropertyDetails], 1)
Any advise or insight is much appreciated!!
Thank you,
Cody
I'm working with a Django system and the thing is pretty simple actually, but one thing got me bothered and I thought that must be a better way to do it.
Basically it's an internal tool for searching the developers the company has available to allocate them in projects based on their skills and interests.
So let's say Employee John can add a Topic React to his list of competence and select his skills levels from 1 to 5 stars, meaning 1 = total beginner and 5 = expert. He can also select his level of interest from 1 to 5. So you can have a list like below
The way this is designed at DB is like this:
Table user with all relevant user information
Table knowledge_topic with columns [id, label], where label is just the name of the language/tech
Table knowledge_level with columns[id, knowledge_level, interest_level, topic_id, user_id] where topic_id makes the relationship to knowledge_topic table and user_id to user table
The competence list endpoint can give a result like this for example:
[
{
"id": 2,
"topic": {
"id": 8,
"label": "Docker"
},
"interest_level": 4,
"knowledge_level": 2,
"user": 2
},
{
"id": 5,
"topic": {
"id": 9,
"label": "Flask"
},
"interest_level": 1,
"knowledge_level": 2,
"user": 2
},
{
"id": 1,
"topic": {
"id": 1,
"label": "React"
},
"interest_level": 4,
"knowledge_level": 4,
"user": 2
},
{
"id": 16,
"topic": {
"id": 3,
"label": "SCSS"
},
"interest_level": 2,
"knowledge_level": 1,
"user": 1
},
{
"id": 136,
"topic": {
"id": 2,
"label": "Django"
},
"interest_level": 1,
"knowledge_level": 1,
"user": 3
},
{
"id": 137,
"topic": {
"id": 9,
"label": "Flask"
},
"interest_level": 1,
"knowledge_level": 1,
"user": 3
},
{
"id": 138,
"topic": {
"id": 3,
"label": "SCSS"
},
"interest_level": 1,
"knowledge_level": 1,
"user": 3
}
]
As you can see, the "uniqueness" here is tied to the combination of user + knowledge. So every time I have an user add a new competence, I'll add an extra row to knowledge_competence table, which to me feels unnecessary.
Is there a better way of doing this or am I overthinking it? I was thinking perhaps creating a table interest with fields [id, level] and competence also with [id, level] and perhaps a "label" field in both tables just to have a text description what the levels mean. Then I can make a relationship chain of user -> topic -> competence and user -> topic -> interest. That way both tables have always 5 rows (the levels of competence and interest), topics always restricted to the universe of languages all employees have in that company and users to all employees. There'll be barely any data to add in DB, only when there is really a new employee or topic. Would this be a good design?
I'd build a table for "devs", and a table for "skills".
Then create a table "dev_skill", to associate devs to skills, with extra data : "interest" and "experience"
There is an exemple on how to do that with django : Django's ManyToMany Relationship with Additional Fields
I am trying to use a "LIKE" search on DynamoDB where I have an array of objects using nodejs.
Looking through the documentation and other related posts I have seen this can be done using the CONTAINS parameter.
My question is - Can I run a scan or query over all of my items in DynamoDB where a value in my object is LIKE "Test 2".
Here is my DynamoDB Table
This is how it looks as JSON:
{
"items": [
{
"description": "Test 1 Description",
"id": "86f550e3-3dee-4fea-84e9-30df174f27ea",
"image": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/86f550e3-3dee-4fea-84e9-30df174f27ea.jpg",
"live": 1,
"status": "new",
"title": "Test 1 Title"
},
{
"description": "Test 2 Description",
"id": "e17dbb45-63da-4567-941c-bb7e31476f6a",
"image": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/e17dbb45-63da-4567-941c-bb7e31476f6a.jpg",
"live": 1,
"status": "new",
"title": "Test 2 Title"
},
{
"description": "Test 3 Description",
"id": "14ad228f-0939-4ed4-aa7b-66ceef862301",
"image": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/14ad228f-0939-4ed4-aa7b-66ceef862301.jpg",
"live": 1,
"status": "new",
"title": "Test 3 Title"
}
],
"userId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}
I am trying to perform a scan / query which will look over ALL users (every row) and look at ALL items and return ALL instances where description is LIKE "Test 2".
I have tried variations of scans as per the below:
{
"TableName": "my-table",
"ConsistentRead": false,
"ExpressionAttributeNames": {
"#items": "items",
},
"FilterExpression": "contains (#items, :itemVal)",
"ExpressionAttributeValues": {
":itemVal":
{
"M": {
"description": {
"S": "Test 2 Description"
},
"id": {
"S": "e17dbb45-63da-4567-941c-bb7e31476f6a"
},
"image": {
"S": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/e17dbb45-63da-4567-941c-bb7e31476f6a.jpg"
},
"live": {
"N": "1"
},
"status": {
"S": "new"
},
"title": {
"S": "Test 2 Title"
}
}
}
}
}
The above scan works but as you can see I am passing in the whole object as an ExpressionAttributeValues, what I want to do is just pass in the description for example something like the below (which doesnt work and returns no items found).
{
"TableName": "my-table",
"ConsistentRead": false,
"ExpressionAttributeNames": {
"#items": "items.description",
},
"FilterExpression": "contains (#items, :itemVal)",
"ExpressionAttributeValues": {
":itemVal":
{
"S": "Test 2"
}
}
}
Alternatively, would it be better to create a separate table where all the items are added and they are linked via the userId? I was always under the impression there should be one table per application but in this instance I think if I had all the item data at the top level, scanning it would be a lot safer and faster.
So with nearly 200 views since posting and no responses I have come up with a solution that does not immediately solve the initial problem (I honestly do not think it can be solved) but have come up with an alternative approach.
Firstly I do not want two tables as this seems overkill, and I do not want the aws costs associated with two tables.
This has lead me to restructure the primary keys with prefixes which I can search over using the "BEGINS_WITH" dynamodb selector query.
Users will be added as U_{USER_ID} and items will be added as I_{USER_ID}_{ITEM_ID}, this way I only have one table to manage and pay for and this allows me to run BEGINS_WITH "U_" to get a list of users or "I_" to get a list of items.
I will then flatten the item data as strings so I can run "contains" searches on any of the item data. This also allows me to run a "contains {USER_ID}" search on the primary keys for items so I can get a list of items for a particular user.
Hope this helps anyone who might come up against the same issue.
This is my response.
[
{
"id": 123,
"name": "text1"
},
{
"id": 456,
"name": "text2"
},
{
"id": 789,
"name": "text3"
}
]
I can just provide the name value and want to get back the id attribute. I am using rest assured. I can create a map and then get it accordingly but searching for solutions like jsonPath().get(id where name ="text2"). Just thinking if anything can be done like that.
You can use conditions like .find{it.name=='text2'}.id
We are using a tool which uses jayway library for evaluating JSONpath expression. Javascript does NOT seem to work with it. How can I use regular expression in the JSONPath in such a case. For instance, in the below example I would like to filter all book titles whose title has the word "Sword" in it:
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{
"category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{
"category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
},
"expensive": 10
}
The Jayway implementation uses the Ruby regex operator:
$.store.book[?(#.title =~ /^.*Sword.*$/)]
To ignore case:
$.store.book[?(#.title =~ /^.*sword.*$/i)]
For the record, a workaround for conditional regex in Goessner's javascript JSONpath would be to write the query as follow:
$.store.book[?(/^.*sword.*$/i.test(#.title))]
Please see here
https://github.com/jpaquit/jsonpath/tree/0.8.5-+-regexp for "=~" syntax in JS lib.
You could use capturing group or lookbehind assertion.
"title":\s*"([^"]*\bSword\b[^"]*)"
Add case-insensitive modifier i if necessary. Grab the title string from group index 1.
DEMO