Does github api provide a way to get user's URL? - github

For example, for user:django, the url I want to retrieve thru github-api is not
https://github.com/django
but
http://www.djangoproject.com/
as shown below in the red ellipse:
The user search api does not return this url in the response.

The Data that returns from the service would be as follows:
https://api.github.com/users/django
{
"public_gists": 0,
"type": "Organization",
"followers": 240,
"login": "django",
"created_at": "2008-10-06T19:43:18Z",
"html_url": "https://github.com/django",
"avatar_url": "https://secure.gravatar.com/avatar/fd542381031aa84dca86628ece84fc07?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png",
"company": null,
"email": null,
"blog": "http://www.djangoproject.com/",
"following": 0,
"name": "Django",
"location": "Internet",
"url": "https://api.github.com/orgs/django",
"id": 27804,
"public_repos": 49
}
As you can see, that URL is in the blog field.

Related

getting multiple photos from Facebook post

I'm now playing with Facebook's Graph API and I'm trying to copy Facebook's posts from a page that I'm administrating to another place.
So far I managed to succesfully get message and full_picture, the problem begins with posts that have several pictures in as if I never get more than one picture from a post.
Graph API reference for posts tells only about returning one link for one picture or full_picture and I didn't find any mentions about getting the biggest number of pictures possible.
Is there any way to get all pictures from posts?
You can get them via the attachments, at least for posts I have made
$ okurl https://graph.facebook.com/v3.1/10153937378849343_10156680000194343/attachments
{
"data": [
{
"subattachments": {
"data": [
{
"media": {
"image": {
"height": 540,
"src": "https://scontent.xx.fbcdn.net/v/t1.0-0/p180x540/xxx_n.jpg",
"width": 720
}
},
"target": {
"id": "10156680000094343",
"url": "https://www.facebook.com/photo.php?fbid=xxx"
},
"type": "photo",
"url": "https://www.facebook.com/photo.php?fbid=xxx"
},
{
"media": {
"image": {
"height": 540,
"src": "https://scontent.xx.fbcdn.net/v/t1.0-0/p180x540/38918411_10156680000119343_5451882299853373440_n.jpg?_nc_cat=0&oh=ac71357254bb90e14e4a658531ff370b&oe=5C08C9C2",
"width": 720
}
},
"target": {
"id": "10156680000109343",
"url": "https://www.facebook.com/photo.php?fbid=xxx"
},
"type": "photo",
"url": "https://www.facebook.com/photo.php?fbid=xxx"
}
]
},
"target": {
"id": "10156680000194343",
"url": "https://www.facebook.com/542634342/posts/10156680000194343/"
},
"title": "Photos from My post",
"type": "album",
"url": "https://www.facebook.com/542634342/posts/10156680000194343/"
}
]
}

facebook api: event url

lets say I know I have an event ID. I would like the event URL (to link users to it), but the graph API does not seem to have it (https://developers.facebook.com/docs/graph-api/reference/event/), for example if I use the command GET /v2.9/310917539364835 HTTP/1.1 the output is:
{
"description": "...",
"end_time": "2017-06-23T22:30:00+1000",
"name": "UQ Postgrad Masquerade Party (End of Semester)",
"place": {
"name": "Cloudland",
"location": {
"city": "Brisbane",
"country": "Australia",
"latitude": -27.45891,
"longitude": 153.0349699,
"state": "QLD",
"street": "641 Ann Street",
"zip": "4006"
},
"id": "103221159774910"
},
"start_time": "2017-06-23T19:30:00+1000",
"id": "310917539364835"
}
but there is not URL.
Thanks
after doing some searching, it turns out that the URL is:
facebook.com/ + ID
so in this example. facebook.com/310917539364835

facebook graph api doesn't return the statuses i shared

I'm trying to fetch all my facebook timeline posts throw the facebook Graph API.
I'm playing with the Graph Explorer and have an access token with this permissions: (user_posts, read_stream) but when i call the endpoint "/posts" or "/feed" in the graph-api, the statues i shared (not i created) on my timeline (friends public status that i shared) didn't return.
this is a screenshot from my timeline
any idea?
If you share another POST - status then I dont think there is a way that will show up in your feed. It will show up under the user's feed who originally shared it, under posts and sharedposts
But if you share a link then it will show up under your feed as shared_story
Example from my feed
{
"data": [
{
"id": "XXXXXXXX",
"from": {
"id": "XXXXXXXX",
"name": "XXXXXXXX"
},
"story": "Vrashabh Irde shared a link.",
"story_tags": {
"0": [
{
"id": "XXXXXXXX",
"name": "XXXXXXXX",
"type": "user",
"offset": 0,
"length": 13
}
]
},
"picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAvV7MyLsxFjRDc&w=130&h=130&url=https%3A%2F%2Ftctechcrunch2011.files.wordpress.com%2F2015%2F05%2Fdave-goldberg.jpg%3Fw%3D560%26h%3D292%26crop%3D1&cfs=1&sx=1&sy=0&sw=292&sh=292",
"link": "http://tcrn.ch/1GR0HU3",
"name": "Dave Goldberg, SurveyMonkey CEO, Dies Unexpectedly",
"caption": "tcrn.ch",
"description": "Silicon Valley and the wider world of technology are mourning the very sudden death of Dave Goldberg, a long time entrepreneur and investor, CEO of..",
"icon": "https://www.facebook.com/images/icons/post.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/XXXXXXXX/posts/XXXXXXXX"
},
{
"name": "Like",
"link": "https://www.facebook.com/XXXXXXXX/posts/XXXXXXXX"
}
],
"privacy": {
"value": "ALL_FRIENDS",
"description": "Your friends",
"friends": "",
"allow": "",
"deny": ""
},
"type": "link",
"status_type": "shared_story",
"created_time": "2015-05-03T14:45:09+0000",
"updated_time": "2015-05-03T14:45:09+0000",
"is_hidden": false,
"subscribed": true
}
This is from what I know, I dont see any documentation that says otherwise, good to have someone from Facebook comment here or you should probably raise a bug if this is not intended.

Get list of related tracks HTTP API SoundCloud

I wasn't able to find anything fitting in HTTP API documentation.
As I know, there's some tracks popping out in SC widget after current track is finished, therefore there is some related tracks functionality in SC itself, yet can we access it via API?
I.e get a list of tracks, related to given track's id.
Disclaimer: This is an undocumented endpoint and is subject to change at anytime by SoundCloud.
There is an undocumented endpoint that allows you to access a track's related sounds:
HTTP GET: https://api.soundcloud.com/tracks/[TRACK_ID]/related?client_id=[YOUR_CLIENT_ID]
You didn't specify a language, so i'm just going to give a high-level overview on how to use the endpoint.
First, get your track URL. I'll use this one as an example: https://soundcloud.com/msmrsounds/ms-mr-hurricane-chvrches-remix
Then hit the resolve endpoint to get the track_id.
HTTP GET: https://api.soundcloud.com/resolve.json?url=https%3A%2F%2Fsoundcloud.com%2Fmsmrsounds%2Fms-mr-hurricane-chvrches-remix&client_id=[YOUR_CLIENT_ID]
Response:
{
"status": "302 - Found",
"location": "https://api.soundcloud.com/tracks/90787841.json?client_id=[YOUR_CLIENT_ID]"
}
Next, hit the related endpoint with your track_id.
HTTP GET: https://api.soundcloud.com/tracks/90787841/related?client_id=[YOUR_ClIENT_ID]
The full response will give you up to 50 related tracks. The response is too large to post, but it's just an array of tracks.
[
{
"kind": "track",
"id": 112741336,
"created_at": "2013/09/27 09:40:29 +0000",
"user_id": 59817646,
"duration": 215896,
"commentable": true,
"state": "finished",
"original_content_size": 38068298,
"last_modified": "2015/04/04 20:17:24 +0000",
"sharing": "public",
"tag_list": "CHVRCHES Whitney Houston Zane Lowe",
"permalink": "chvrches-its-not-right-but-its",
"streamable": true,
"embeddable_by": "all",
"downloadable": false,
"purchase_url": null,
"label_id": null,
"purchase_title": null,
"genre": "Electronic",
"title": "CHVRCHES - It's Not Right But It's Okay (Whitney Houston Cover)",
"description": "CHVRCHES - It's Not Right But It's OK (Whitney Houston Cover) from Zane's Live Sessions",
"label_name": "",
"release": "",
"track_type": "recording",
"key_signature": "",
"isrc": "",
"video_url": null,
"bpm": null,
"release_year": null,
"release_month": null,
"release_day": null,
"original_format": "wav",
"license": "all-rights-reserved",
"uri": "https://api.soundcloud.com/tracks/112741336",
"user": {
"id": 59817646,
"kind": "user",
"permalink": "uknewmusic",
"username": "UKNewMusic",
"last_modified": "2013/09/27 09:38:04 +0000",
"uri": "https://api.soundcloud.com/users/59817646",
"permalink_url": "http://soundcloud.com/uknewmusic",
"avatar_url": "https://a1.sndcdn.com/images/default_avatar_large.png"
},
"permalink_url": "http://soundcloud.com/uknewmusic/chvrches-its-not-right-but-its",
"artwork_url": "https://i1.sndcdn.com/artworks-000058757165-6tnuep-large.jpg",
"waveform_url": "https://w1.sndcdn.com/XkEffI5hwjZ7_m.png",
"stream_url": "https://api.soundcloud.com/tracks/112741336/stream",
"playback_count": 680326,
"download_count": 0,
"favoritings_count": 9241,
"comment_count": 199,
"attachments_uri": "https://api.soundcloud.com/tracks/112741336/attachments",
"policy": "ALLOW"
},
{ ...
}
]

Facebook Graph API posts not appearing for users of page, only admin

I created a page on facebook, and am using the graph api to make posts on the timeline. These post show up just fine for me as the admin, but for users the page is empty.
I verified with the graph api explorer. As an admin a GET of /NewsCrier/feed is filled with data.
As a non admin user the same request returns
{
"data": [ ]
}
Here is an example post from the response of my admin user, notice the privacy is set to public:
{
"id": "383422711781035_404880726301900",
"from": {
"category": "Community",
"name": "News Crier",
"id": "383422711781035"
},
"message": "This appears to be the DC shooter, Aaron Alexis",
"picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQD4wR0Y9UVbb4Js&w=154&h=154&url=http%3A%2F%2Fwww.justmugshots.com%2Fimg%2F814064%2Flg%2Faaron-alexis.jpg",
"link": "http://www.justmugshots.com/texas/fort-worth/814064",
"name": "Aaron Alexis, Arrested on 2010-09-04",
"caption": "www.justmugshots.com",
"description": "Aaron Alexis was arrested in Fort Worth, Texas on 2010-09-04. See the mugshot now.",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/383422711781035/posts/404880726301900"
},
{
"name": "Like",
"link": "https://www.facebook.com/383422711781035/posts/404880726301900"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "link",
"status_type": "shared_story",
"application": {
"name": "Reddit News Alerts",
"id": "693375074022011"
},
"created_time": "2013-09-16T19:36:07+0000",
"updated_time": "2013-09-16T19:36:07+0000"
}
The problem is that your Facebook app is in sandbox mode, as soon as you take the app from sandbox all the users will se the newly created posts ;)