How to get the Social preview of a github project? - github

I could get the project, but it does not retrieve the Social Preview of the project:
The link that I'm using is this one:
https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD
which is returning the following:
{
"id": 215636067,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTU2MzYwNjc=",
"name": "BCMIC-PHD",
"full_name": "AngelRibeiro10/BCMIC-PHD",
"private": false,
"owner": {
"login": "AngelRibeiro10",
"id": 13433634,
"node_id": "MDQ6VXNlcjEzNDMzNjM0",
"avatar_url": "https://avatars2.githubusercontent.com/u/13433634?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AngelRibeiro10",
"html_url": "https://github.com/AngelRibeiro10",
"followers_url": "https://api.github.com/users/AngelRibeiro10/followers",
"following_url": "https://api.github.com/users/AngelRibeiro10/following{/other_user}",
"gists_url": "https://api.github.com/users/AngelRibeiro10/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AngelRibeiro10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AngelRibeiro10/subscriptions",
"organizations_url": "https://api.github.com/users/AngelRibeiro10/orgs",
"repos_url": "https://api.github.com/users/AngelRibeiro10/repos",
"events_url": "https://api.github.com/users/AngelRibeiro10/events{/privacy}",
"received_events_url": "https://api.github.com/users/AngelRibeiro10/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/AngelRibeiro10/BCMIC-PHD",
"description": "This is a Brain-Computer Music Interfacing Project",
"fork": false,
"url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD",
"forks_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/forks",
"keys_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/teams",
"hooks_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/hooks",
"issue_events_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues/events{/number}",
"events_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/events",
"assignees_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/assignees{/user}",
"branches_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/branches{/branch}",
"tags_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/tags",
"blobs_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/statuses/{sha}",
"languages_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/languages",
"stargazers_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/stargazers",
"contributors_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/contributors",
"subscribers_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/subscribers",
"subscription_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/subscription",
"commits_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/contents/{+path}",
"compare_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/merges",
"archive_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/downloads",
"issues_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues{/number}",
"pulls_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/pulls{/number}",
"milestones_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/milestones{/number}",
"notifications_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/labels{/name}",
"releases_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/releases{/id}",
"deployments_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/deployments",
"created_at": "2019-10-16T20:14:22Z",
"updated_at": "2019-11-14T16:52:13Z",
"pushed_at": "2019-11-14T16:52:11Z",
"git_url": "git://github.com/AngelRibeiro10/BCMIC-PHD.git",
"ssh_url": "git#github.com:AngelRibeiro10/BCMIC-PHD.git",
"clone_url": "https://github.com/AngelRibeiro10/BCMIC-PHD.git",
"svn_url": "https://github.com/AngelRibeiro10/BCMIC-PHD",
"homepage": null,
"size": 69612,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": {
"key": "apache-2.0",
"name": "Apache License 2.0",
"spdx_id": "Apache-2.0",
"url": "https://api.github.com/licenses/apache-2.0",
"node_id": "MDc6TGljZW5zZTI="
},
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"temp_clone_token": null,
"network_count": 0,
"subscribers_count": 1
}
I want to get this picture of 'Social Preview' ... but it doent show in the returning of the project atributes.
Thank you very much :)

So it's not possible to retrieve it from the API, but in my case since I only displayed my top three repos on my website it wasn't a pain to manually grab the image URLs.
I did this by uploading the preview image on GitHub, then right click on the image when it pops up -> inspect and you'll see in the developer tools the element has a 'background-image: url()' property, right click on that URL and then open in new tab, and there's the URL for your image!
Like I said, it's a manual process but if you need to only do it a few times then it's not a huge deal. That was my workaround.

Related

Resolving a GitHub Issue from a Project Card via the RESTful SDK

I'm using octokit (https://octokit.github.io/rest.js/v18#projects-list-cards) to interact with my Project and Issues in my repo. I have the project_cards in a list, but I'd like to make some changes to the labels on the issue when I move from column to column.
As near as I can tell (https://docs.github.com/en/rest/reference/projects#list-project-cards), the only way to get the issue number is to manually parse the content_url field:
[
{
"url": "https://api.github.com/projects/columns/cards/1478",
"id": 1478,
"node_id": "MDExOlByb2plY3RDYXJkMTQ3OA==",
"note": "Add payload for delete Project column",
"creator": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-09-05T14:21:06Z",
"updated_at": "2016-09-05T14:20:22Z",
"archived": false,
"column_url": "https://api.github.com/projects/columns/367",
"content_url": "https://api.github.com/repos/api-playground/projects-test/issues/3",
"project_url": "https://api.github.com/projects/120"
}
]
This seems pretty surprising to me, am i missing something? I'm just looking to figure out what the underlying issue number is so that I can do some manipulation of the labels.

I can't hide the browser bar on TWA

if anyone can help me with my problem thank you, i will explain better.
I am trying to remove the browser bar from the top of my TWA, I have tried several things I read on the internet but so far nothing.
I already created the file "assetlinks.json" with my two fingerprints, both the app signature and the upload signature.
And yet the browser bar appears at the top of my application.
Here is the link to my "assetlinks.json":
https://app.planetspay.com.br/.well-known/assetlinks.json
Follow my application's link on Google Play:
https://play.google.com/store/apps/details?id=app.planetsplay.com.br
Here is my TWA-manifest.json file:
{
"packageId": "app.planetsplay.com.br",
"host": "app.planetspay.com.br",
"name": "PlanetsPay",
"launcherName": "PlanetsPay",
"display": "standalone",
"themeColor": "#16A591",
"navigationColor": "#16A591",
"navigationColorDark": "#16A591",
"navigationDividerColor": "#16A591",
"navigationDividerColorDark": "#16A591",
"backgroundColor": "#FFFFFF",
"enableNotifications": true,
"startUrl": "/logar?ref=twa",
"iconUrl": "https://app.planetspay.com.br/img/icone-app.png",
"splashScreenFadeOutDuration": 0,
"signingKey": {
"path": "F:\\RubensFlinco-PC\\Documents\\Github\\PlanetsPay-Aplicativo\\android.keystore",
"alias": "android"
},
"appVersionName": "2",
"appVersionCode": 2,
"shortcuts": [
{
"name": "Meu QRCode",
"shortName": "QRCode",
"url": "https://app.planetspay.com.br/qrcode?twa=true&utm_source=shortcuts",
"chosenIconUrl": "https://app.planetspay.com.br/img/icons/qrcode.png"
},
{
"name": "Emitir cobrança",
"shortName": "Cobrar",
"url": "https://app.planetspay.com.br/pessoal/cobrar?twa=true&utm_source=shortcuts",
"chosenIconUrl": "https://app.planetspay.com.br/img/icons/cobrar.png"
},
{
"name": "Transferir dinheiro",
"shortName": "Transferir",
"url": "https://app.planetspay.com.br/pessoal/dinheiro/transferir?twa=true&utm_source=shortcuts",
"chosenIconUrl": "https://app.planetspay.com.br/img/icons/transferir.png"
},
{
"name": "Ver meu extrato",
"shortName": "Extrato",
"url": "https://app.planetspay.com.br/pessoal/extrato?twa=true&utm_source=shortcuts",
"chosenIconUrl": "https://app.planetspay.com.br/img/icons/extrato.png"
}
],
"generatorApp": "bubblewrap-cli",
"webManifestUrl": "https://app.planetspay.com.br/manifest.json",
"fallbackType": "customtabs",
"features": {},
"alphaDependencies": {
"enabled": false
},
"enableSiteSettingsShortcut": false,
"isChromeOSOnly": false,
"orientation": "portrait",
"fingerprints": [],
"appVersion": "2"
}
I discovered that it was my typo in the package name

Github "Problems parsing JSON", Creating Repository from console on Windows 10

I was trying to create a new Repository from CMD on Windows 10 Pro, following this answer:
https://stackoverflow.com/a/10325316
My First Try
C:\Users\joseluisbz>curl -u joseluisbz https://api.github.com/user/repos -d '{"name":"BasicOperations"}'
Enter host password for user 'joseluisbz':
{
"message": "Problems parsing JSON",
"documentation_url": "https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user"
}
The second try
C:\Users\joseluisbz>curl -u joseluisbz https://api.github.com/user/repos -d \'{"name":"BasicOperations"}\'
Enter host password for user 'joseluisbz':
{
"message": "Problems parsing JSON",
"documentation_url": "https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user"
}
C:\Users\joseluisbz>
From macOS works perfectly.
joseluisbz#Joses-MacBook-Air Java % curl -u joseluisbz https://api.github.com/user/repos -d '{"name":"BasicOperations"}'
Enter host password for user 'joseluisbz':
{
"id": 293512428,
"node_id": "I CHANGED THIS HASH",
"name": "BasicOperations",
"full_name": "joseluisbz/BasicOperations",
"private": false,
"owner": {
"login": "joseluisbz",
"id": 16026347,
"node_id": "I CHANGED THIS HASH",
"avatar_url": "https://avatars2.githubusercontent.com/u/16026347?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/joseluisbz",
"html_url": "https://github.com/joseluisbz",
"followers_url": "https://api.github.com/users/joseluisbz/followers",
"following_url": "https://api.github.com/users/joseluisbz/following{/other_user}",
"gists_url": "https://api.github.com/users/joseluisbz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/joseluisbz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joseluisbz/subscriptions",
"organizations_url": "https://api.github.com/users/joseluisbz/orgs",
"repos_url": "https://api.github.com/users/joseluisbz/repos",
"events_url": "https://api.github.com/users/joseluisbz/events{/privacy}",
"received_events_url": "https://api.github.com/users/joseluisbz/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/joseluisbz/BasicOperations",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/joseluisbz/BasicOperations",
"forks_url": "https://api.github.com/repos/joseluisbz/BasicOperations/forks",
"keys_url": "https://api.github.com/repos/joseluisbz/BasicOperations/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/joseluisbz/BasicOperations/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/joseluisbz/BasicOperations/teams",
"hooks_url": "https://api.github.com/repos/joseluisbz/BasicOperations/hooks",
"issue_events_url": "https://api.github.com/repos/joseluisbz/BasicOperations/issues/events{/number}",
"events_url": "https://api.github.com/repos/joseluisbz/BasicOperations/events",
"assignees_url": "https://api.github.com/repos/joseluisbz/BasicOperations/assignees{/user}",
"branches_url": "https://api.github.com/repos/joseluisbz/BasicOperations/branches{/branch}",
"tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations/tags",
"blobs_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/joseluisbz/BasicOperations/statuses/{sha}",
"languages_url": "https://api.github.com/repos/joseluisbz/BasicOperations/languages",
"stargazers_url": "https://api.github.com/repos/joseluisbz/BasicOperations/stargazers",
"contributors_url": "https://api.github.com/repos/joseluisbz/BasicOperations/contributors",
"subscribers_url": "https://api.github.com/repos/joseluisbz/BasicOperations/subscribers",
"subscription_url": "https://api.github.com/repos/joseluisbz/BasicOperations/subscription",
"commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/joseluisbz/BasicOperations/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/joseluisbz/BasicOperations/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/joseluisbz/BasicOperations/contents/{+path}",
"compare_url": "https://api.github.com/repos/joseluisbz/BasicOperations/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/joseluisbz/BasicOperations/merges",
"archive_url": "https://api.github.com/repos/joseluisbz/BasicOperations/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/joseluisbz/BasicOperations/downloads",
"issues_url": "https://api.github.com/repos/joseluisbz/BasicOperations/issues{/number}",
"pulls_url": "https://api.github.com/repos/joseluisbz/BasicOperations/pulls{/number}",
"milestones_url": "https://api.github.com/repos/joseluisbz/BasicOperations/milestones{/number}",
"notifications_url": "https://api.github.com/repos/joseluisbz/BasicOperations/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/joseluisbz/BasicOperations/labels{/name}",
"releases_url": "https://api.github.com/repos/joseluisbz/BasicOperations/releases{/id}",
"deployments_url": "https://api.github.com/repos/joseluisbz/BasicOperations/deployments",
"created_at": "2020-09-07T11:45:04Z",
"updated_at": "2020-09-07T11:45:04Z",
"pushed_at": "2020-09-07T11:45:06Z",
"git_url": "git://github.com/joseluisbz/BasicOperations.git",
"ssh_url": "git#github.com:joseluisbz/BasicOperations.git",
"clone_url": "https://github.com/joseluisbz/BasicOperations.git",
"svn_url": "https://github.com/joseluisbz/BasicOperations",
"homepage": null,
"size": 0,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": null,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"delete_branch_on_merge": false,
"network_count": 0,
"subscribers_count": 1
}
joseluisbz#Joses-MacBook-Air Java %
EDIT 1:
C:\Users\joseluisbz>curl --version
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: 2017-11-14, security patched: 2019-11-05
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
C:\Users\joseluisbz>
I was testing too with https://curl.haxx.se/windows/dl-7.72.0_4/curl-7.72.0_4-win64-mingw.zip with the same problems
D:\Programs\curl-7.72.0-win64-mingw\bin
λ curl.exe --version
curl 7.72.0 (x86_64-pc-win32) libcurl/7.72.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.9 zstd/1.4.5 WinIDN libssh2/1.9.0 nghttp2/1.41.0
Release-Date: 2020-08-19
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP Unicode UnixSockets brotli libz zstd
D:\Programs\curl-7.72.0-win64-mingw\bin
What would be the problem?
Thanks in advance.
It is working changing the Trailing BackSlash
curl -u joseluisbz https://api.github.com/user/repos -d "{\"name\":\"BasicOperations3\"}"
Example
i:\joseluisbz\NetBeansProjects\BasicOperations (master -> origin)
λ curl -u joseluisbz https://api.github.com/user/repos -d "{\"name\":\"BasicOperations3\"}"
Enter host password for user 'joseluisbz':
{
"id": 293578020,
"node_id": "CHANCED HASH",
"name": "BasicOperations3",
"full_name": "joseluisbz/BasicOperations3",
"private": false,
"owner": {
"login": "joseluisbz",
"id": 16026347,
"node_id": "CHANCED HASH",
"avatar_url": "https://avatars2.githubusercontent.com/u/16026347?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/joseluisbz",
"html_url": "https://github.com/joseluisbz",
"followers_url": "https://api.github.com/users/joseluisbz/followers",
"following_url": "https://api.github.com/users/joseluisbz/following{/other_user}",
"gists_url": "https://api.github.com/users/joseluisbz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/joseluisbz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joseluisbz/subscriptions",
"organizations_url": "https://api.github.com/users/joseluisbz/orgs",
"repos_url": "https://api.github.com/users/joseluisbz/repos",
"events_url": "https://api.github.com/users/joseluisbz/events{/privacy}",
"received_events_url": "https://api.github.com/users/joseluisbz/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/joseluisbz/BasicOperations3",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/joseluisbz/BasicOperations3",
"forks_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/forks",
"keys_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/teams",
"hooks_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/hooks",
"issue_events_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/issues/events{/number}",
"events_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/events",
"assignees_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/assignees{/user}",
"branches_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/branches{/branch}",
"tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/tags",
"blobs_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/statuses/{sha}",
"languages_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/languages",
"stargazers_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/stargazers",
"contributors_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/contributors",
"subscribers_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/subscribers",
"subscription_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/subscription",
"commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/contents/{+path}",
"compare_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/merges",
"archive_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/downloads",
"issues_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/issues{/number}",
"pulls_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/pulls{/number}",
"milestones_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/milestones{/number}",
"notifications_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/labels{/name}",
"releases_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/releases{/id}",
"deployments_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/deployments",
"created_at": "2020-09-07T16:26:45Z",
"updated_at": "2020-09-07T16:26:45Z",
"pushed_at": "2020-09-07T16:26:46Z",
"git_url": "git://github.com/joseluisbz/BasicOperations3.git",
"ssh_url": "git#github.com:joseluisbz/BasicOperations3.git",
"clone_url": "https://github.com/joseluisbz/BasicOperations3.git",
"svn_url": "https://github.com/joseluisbz/BasicOperations3",
"homepage": null,
"size": 0,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": null,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"delete_branch_on_merge": false,
"network_count": 0,
"subscribers_count": 1
}
i:\joseluisbz\NetBeansProjects\BasicOperations (master -> origin)

get json key value using powershell

I have the following json output string:
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 1
},
"objects": [{
"bcontext": "/api/v2.0/buildercontext/2/",
"bugs": [],
"build": {
"bldtype": "obj",
"branch": "main",
"buildstatus": [{
"build": "/api/v2.0/build/2140634/",
"failurereason": "_checkfailures (seen: FAIL - /testrun/18647678/ - area[4769] AIM-SANITY)",
"id": "1294397",
"lastupdate": "2015-03-31T14:30:18",
"overridden": false,
"overridedesc": "",
"overrideuser": null,
"recommended": false,
"resource_uri": "/api/v2.0/buildstatus/1294397/",
"slatype": {
"id": "26",
"name": "VA_Bats",
"resource_uri": "/api/v2.0/sla/26/"
}
}],
"changeset": "494625",
"coverage": false,
"deliverables": ["/api/v2.0/deliverable/4296455/", "/api/v2.0/deliverable/4296956/", "/api/v2.0/deliverable/4296959/", "/api/v2.0/deliverable/4296986/", "/api/v2.0/deliverable/4296992/", "/api/v2.0/deliverable/4296995/", "/api/v2.0/deliverable/4297034/", "/api/v2.0/deliverable/4297058/"],
"git_host": null,
"git_repo": null,
"id": "2140634",
"p4host": {
"id": "10",
"p4port": "perforce-rhino.eng.com:1800",
"p4weburl": "http://p4web.eng.com:1800",
"resource_uri": "/api/v2.0/perforceserver/10/"
},
"resource_uri": "/api/v2.0/build/2140634/",
"site": "/api/v2.0/site/25/",
"site_name": "mbu",
"slastested": ["/api/v2.0/sla/26/"],
"submit_time": "2015-03-31T05:40:21",
"submit_user": "haharonof"
},
"builder": "/api/v2.0/builder/1423/",
"clean": true,
"componentbuilds": "vcops-vsphere-solution-pak=sb-5242047,vrops=sb-5242013,vscm=sb-5242025,vsutilities=sb-5242029;parentbuilder=1410",
"deleted": false,
"endtime": "2015-03-31T06:20:58",
"helpzillas": [],
"id": "4296956",
"location": {
"httpserver": "sc-prd-cat-services001.eng.com",
"id": "1",
"name": "PA",
"nfsserver": "cat-results.eng.com",
"pxedir": "/mts/builder-pxe",
"resource_uri": "/api/v2.0/location/1/",
"resultspath": "/results"
},
"nfsserver": "build-storage60",
"p4client": "vmktestdevnanny-builder-1423",
"path": "/storage60/release/sb-5242148",
"ready": true,
"resource_uri": "/api/v2.0/deliverable/4296956/",
"result": "PASS",
"sbbuildid": 5242148,
"sbjobid": 5242148,
"sbuser": "arajamanickam",
"starttime": "2015-03-31T06:16:50",
"targetchangeset": "494625",
"targets": "vcopssuitevm",
"triagetime": null,
"vmodl": null
}]
}
I want to get sbbuildid using powershell. How can I get this?
By converting your json to an object, using the ConvertFrom-Json cmdlet (assuming $jsonString contains the json above):
$jsonObj = $jsonString | ConvertFrom-Json
$jsonObj.objects.sbbuildid
$sb_build_id = $build_info.Substring($build_info.IndexOf("sbbuildid") + 11, 8).trim()
Put whole string in $build_info

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

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.