Developing a twitter connect app and getting the trends with the url:
https://api.twitter.com/1.1/trends/closest.json?lat=42&long=36
Output:
[
{
"name": "Turkey",
"placeType": {
"code": 12,
"name": "Country"
},
"url": "http://where.yahooapis.com/v1/place/23424969",
"parentid": 1,
"country": "Turkey",
"woeid": 23424969,
"countryCode": "TR"
}
]
How can i get the actual content of the trends? Hope there are some solutions. Thanks
You want to call
GET trends/place
not trends/closest you have everything in api documentation
documentation
Related
I am working on the Majento2 web api and I have no knowledge regarding use of the magenta web api, so please help me regarding how to implement post and get magenta web services in iOS project. i like to handle this form of data:-
{
"items": [
{
"id": 1,
"sku": "521609",
"name": "BUDWEISER 36 CAN ",
"attribute_set_id": 4,
"price": 72.5,
"status": 1,
"visibility": 4,
"type_id": "simple",
"created_at": "2018-11-17 18:36:26",
"updated_at": "2018-11-18 16:01:45",
"product_links": [],
"tier_prices": [],
"custom_attributes": [
{
"attribute_code": "meta_title",
"value": "BUDWEISER 36 CAN "
},
I am trying to pull code review reports from the TFSGIT/VSTS, but I don't see anything out of the box.
The 3rd part code review tools like "ReviewAssistant" works great but they are not integrated with the Pull Request. It decouples code review to pull request.
I would like to get reports from the PullRequest code comments.
You can pull data from TFS with Rest API.
To get the PR code comments you can use the Pull Request Threads - List.
The request is:
https://{instance}/{collection}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads?api-version=4.1
In the JSON response, you will get the comments and the comment location in the code (line number):
"comments": [
{
"id": 1,
"parentCommentId": 0,
"author": {
"displayName": "Shayki Abramczyk",
"url": "https://spsprodweu3.vssps.visualstudio.com/Ac256a93d-7cea-4070-xxxxxxxxx/_apis/Identities/7a9a9b44-a2f1-6dfd-a7f6-xxxxxxxxxx",
"_links": {
"avatar": {
"href": "https://dev.azure.com/xxxxxx/_apis/GraphProfile/MemberAvatars/msa.N2E5YTlxxxxxxxxxxxxxxx"
}
},
"id": "7a9a9b44-a2f1-6dfd-a7f6-xxxxxxxxxx",
"uniqueName": "xxxxxxxx",
"imageUrl": "https://dev.azure.com/xxxxxxxx/_api/_common/identityImage?id=7a9a9b44-a2f1-6dfd-a7f6-xxxxxxxxxx",
"descriptor": "msa.N2E5YTliNDQtYTJmMS03ZGZkLWE3Zjxxxxxxxxxxx"
},
"content": "test comment",
"publishedDate": "2019-02-25T11:11:03.45Z",
"lastUpdatedDate": "2019-02-25T11:11:03.45Z",
"lastContentUpdatedDate": "2019-02-25T11:11:03.45Z",
"commentType": "text",
"usersLiked": [
]
}
],
"status": "active",
"threadContext": {
"filePath": "/SampleForVSTS/Program.cs",
"leftFileStart": {
"line": 14,
"offset": 1
},
"leftFileEnd": {
"line": 14,
"offset": 10
}
},
As you can see there is a comment test comment at line 14 in the file SampleForVSTS/Program.cs.
You can write simple code in any language to get the data with Rest API.
I am developing a solution for a product and trying to implement C2C connection. I am in stuck with linking SmartThings with my backend via OAuth.
I get request
{
"lifecycle": "CONFIGURATION",
"executionId": "41d224ba-7de3-77ac-fe87-a56fa6f325c3",
"locale": "en",
"version": "0.1.0",
"client": {
"os": "ios",
"version": "1.6.17",
"language": "uk"
},
"configurationData": {
"installedAppId": "7393625f-64d5-42cb-a52f-7935a677c4bb",
"phase": "PAGE",
"pageId": "linkPage",
"previousPageId": "",
"config": {}
},
"settings": {}
}
And return response, that is rendered in SmartThings App:
{
"configurationData": {
"page": {
"pageId": "linkPage",
"nextPageId": "",
"previousPageId": "",
"complete": true,
"name": "Account Linking",
"sections": [ {
"name": "Please, link SmartThings to your XXXXXX account",
"settings": [ {
"id": "linkAccount",
"name": "Link Account",
"type": "OAUTH",
"required": true,
"urlTemplate": "https://xxxxxx.auth.us-east-2.amazoncognito.com/login?response_type=code&client_id=20kucf9dcg5ju9deqeppugqft1&state=7393625f-64d5-42cb-a52f-7935a677c4bb&redirect_uri=https%3A%2F%2Fapi.smartthings.com%2Foauth%2Fcallback"
} ]
} ]
}
}
}
Authentication passes successfully and returns code to callback like that:
https://api.smartthings.com/oauth/callback?code=9dfea1ca-54e8-47e8-ba90-24f20068ad2b&state=7393625f-64d5-42cb-a52f-7935a677c4bb
But the callback returns HTTP 401.
I've read this topic https://community.smartthings.com/t/cloud-to-cloud-oauth-rest-api/118902 and did not find a solution. No more helpful info I could found on the Web.
Has anybody implemented this with success?
The Support is awful - no response for several days.. From my previous Support contacting experience - they can respond after several weeks...
Thank you!
This is a bug of iOS SmartThings application, Android works fine.
https://community.smartthings.com/t/cant-implement-oauth-for-cloud-to-cloud/143258/7
i am trying to fetch a json data in my rails app from a url. how to make this api call.
{
"name": "MagicList",
"count": 20,
"frequency": "realtime",
"version": 5,
"newdata": true,
"lastrunstatus": "success",
"lastsuccess": "Sat Apr 26 2014 14:34:40 GMT+0000 (UTC)",
"results": {
"collection1": [
{
"Title": {
"href": "http://www.magicbricks.com/propertyDetails/2-BHK-746-Sq-ft-Multistorey-Apartment-FOR-Sale-Sector-79-in-Gurgaon&id=C0gt4k2Fa9tzpSvf+uAgZw==",
"text": "2 BHK Multistorey Apartment in Sector-79"
},
"Price": "37.99 Lac(s)",
"Rate": "5,092",
"Size": "746 Sq-ft",
"Project Name": "",
"New_Resale": "New Property"
},
{
"Title": {
"href": "http://www.magicbricks.com/propertyDetails/2-BHK-1050-Sq-ft-Multistorey-Apartment-FOR-Sale-Sector-68-in-Gurgaon&id=M5jckQCuJaBzpSvf+uAgZw==",
"text": "2 BHK Multistorey Apartment in Sector-68"
},
"Price": "57.50 Lac(s)",
"Rate": "5,476",
"Size": "1050 Sq-ft",
"Project Name": "Project: Pareena Sec68",
"New_Resale": "New Property"
},
{
"Title": {
"href": "http://www.magicbricks.com/propertyDetails/3-BHK-1875-Sq-ft-Multistorey-Apartment-FOR-Sale-Sector-37C-in-Gurgaon&id=gw8zjmcA/b1zpSvf+uAgZw==",
"text": "3 BHK Multistorey Apartment in Sector-37C"
},
"Price": "60.0 Lac(s)\nOnwards",
"Rate": "3,200",
"Size": "1875 Sq-ft",
"Project Name": "Project: Spire Greens",
"New_Resale": "Resale"
}
}
}
dont know how it can be achieved, which gem should be used.
Using 'open-uri'
url = "http://..."
data = JSON.parse(open(url).read)
Or using 'net'
require "net/http"
url = "http://..."
resp = Net::HTTP.get_response(URI.parse(url))
data = JSON.parse(resp.body)
This is not an answer to your question, but stack overflow won't let me post a comment without 50 reputation.
You may want to edit your API key out of your question, since it's the equivalent of your password for using their API services.
Yes you can easily use builtin stuff:
uri = "https://yourapithinkg.com/list?api_key=#{ENV.fetch('API_KEY')}"
result = JSON.parse(Net::HTTP.get(URI.parse(uri)))
Most people like to load in other libraries but its not really worth it.
I am getting user's timeline from an iOS app, with a big number of tweets being pulled from the API. I am using the statuses/user_timeline endpoint to get the data, however, as I'm on a mobile device and as I only need the tweet text only, I'd like to filter only the actual text data of the tweets. I've already set include_entities to no and trim_user to true, but even with entities and user data trimmed off, I'm still getting a lot of data that I don't need. Here is a sample tweet that I get from the endpoint:
{
"created_at": "Tue Nov 27 14:13:13 +0000 2012",
"id": 273429272209801200,
"id_str": "273429272209801217",
"text": "you could list #5ThingsIFindAttractive but you can actually find them on Facebook with Social Match on iPhone! http://t.co/zRr1ggbz",
"source": "web",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 62828168,
"id_str": "62828168"
},
"geo": null,
"coordinates": null,
"place": {
"id": "682c5a667856ef42",
"url": "http://api.twitter.com/1/geo/id/682c5a667856ef42.json",
"place_type": "country",
"name": "Turkey",
"full_name": "Turkey",
"country_code": "TR",
"country": "Turkey",
"bounding_box": {
"type": "Polygon",
"coordinates": [
[
[
25.663883,
35.817497
],
[
44.822762,
35.817497
],
[
44.822762,
42.109993
],
[
25.663883,
42.109993
]
]
]
},
"attributes": {}
},
"contributors": null,
"retweet_count": 0,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false
}
The only thing I actually need is the text key of the dictionary. The rest is currently useless for my app. I'll be requesting LOTS of tweets like this. How can I send a request to just to pull of the text key of the tweets? Currently, this method is extremely inefficient.
You can't. The best you can do is set up a proxy which will request the data, strip it back, and then forward it to the mobile.
If it's any consolation, the JSON will be gzip'd and so should still be relatively small - so won't take too long to transfer or eat in to the user's data allowance.