Get Theme and Wordpress version details via API - wordpress-theming

wordpress gives API for all plugins including change log , version , details, screenshots..etc in http://codex.wordpress.org/WordPress.org_API
For example
https://api.wordpress.org/plugins/info/1.0/BuddyPress
Same way themes and wordpress every version i need to get these details. i have tried with https://api.wordpress.org/themes/info/1.1/
and it shows nothing and i do not know where to modify this api url to get particular details of a theme.

Use the $request parameter to pass the arguments, for example to get infos on Twentyfifteen theme:
https://api.wordpress.org/themes/info/1.1/?action=theme_information&request[slug]=twentyfifteen
Or to get the first 3 themes by the author Wordpress.org:
https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[author]=wordpressdotorg&request[per_page]=3

Related

"Universal Android App" (template) news mobile app, list not working

sorry for bothering you. I need help with this template:
https://codecanyon.net/item/universal-full-multipurpose-android-app/6512720
I would like to insert my website (in Altervista, www.umbertoprimo.altervista.org) listing the news, but I have a problem.
What is written in the documentation:
If you would like to show the latest WordPress posts or a category in your app, you can add a WordPress item to the menu. We have installed our API plugin as documented earlier. Now follow the instructions depending on if you are using the JSON API or the JetPack / WordPress.com API.
JSON API You can use the following values for your configuration: The
first parameter is the url to your WordPress blog (starting with
http:// and not ending with a slash). The second parameter is a
category slug (which you can leave empty for all posts combined). The
last and third parameter is optional, and this is a Disqus formatted
string.
I installed the JSON API in the website with Wordpress but... this is what I came with.
[
{
"title":"Inter Nos",
"drawable":"",
"submenu":"",
"iap":false,
"tabs":[
{
"title":"Post Recenti",
"provider":"wordpress",
"arguments":[
"http://umbertoprimo.altervista.org"
]
},
{
"title":"Numeri Interi",
"provider":"wordpress",
"arguments":[
"org.altervista.umberto",
"numeri-interi"
]
},
{
"title":"Contatti",
"provider":"wordpress",
"arguments":[
"en.blog.wordpress.com",
"security"
]
}
]
},
(config.json, using Android Studio)
And the "Contatti" table works, showing all the news from the "blog.wordpress", but the recent posts and numeri-interi don't.
I tried using as provider "altervista", but nothing.
What can I do?
Thanks in advance, this is just a test as part of my app.
P.S. When I build the app, no problem, but when I open it... Image1
Image 2
You need to install Jetpack for you to use that option because the Api's are different. The "Post Recenti" works because you have the Json Api installed, the "Contatti" works beacause wordpress has the Jetpack plugin installed and its contains the wordpress resp api.

Get Steam API bundle JSON

Does anyone know a way of getting details of DLC and Bundles from steam?
I can easily get App details with the following URL: (Borderlands 2)
http://store.steampowered.com/api/appdetails?appids=49520
This is the store page, notice the GET part of the URL is /app/{id}/
http://store.steampowered.com/app/49520/
Now I need to get the same sort of result from the API for a bundle.
This is the store page, notice the GET part of the URL is /sub/{id}/
http://store.steampowered.com/sub/32848/
I tried
http://store.steampowered.com/api/subdetails?subids=32848
and get Access Denied.
Any suggestions?
You should use package instead of sub to get the information.
You can use below link to access the package info
http://store.steampowered.com/api/packagedetails?packageids=32848
There is currently no way to get bundle info, without scraping the HTML. Only apps/packages.

How to restrict fields returned by stackexchange api, and turn off paging?

I'd like to have a list of just the current titles for all questions in one of the smaller (less than 10,000 questions) stackexchange site. I tried the interactive utility here: https://api.stackexchange.com/docs/questions and it both reports the result as a json at the bottom, and produces the requesting url at the top. For example:
https://api.stackexchange.com/2.2/questions?order=desc&sort=activity&tagged=apples&site=cooking
returns this JSON in my browser:
{"items":[{"tags":["apples","crumble"],"owner":{ ...
...
...],"has_more":true,"quota_max":300,"quota_remaining":252}
What is quota? It was 10,000 on one search on one site, but suddenly it's only 300 here.
I won't be doing this very often, what I'd like is the quickest way to edit that (or similar of course) url so I can get a list of all of the titles on a small site. I don't understand how to use paging, and I don't need any of the other fields. I don't care if I get them, but I'm thinking if I exclude them I can have more at once.
If I need to script it, python (2.7) is my preferred (only) language.
quota_max is the number of requests your application is allowed per day. 300 is the default for an unregistered application. This used to be mentioned directly on the page describing throttles, but seems to have been removed. Here is historical information describing the default.
To increase this to 10,000, you need to register an application and then authenticate by passing an access token in your script.
To get all titles on a site, you can use a Python library to help:
StackAPI. The answer below will use this library. DISCLAIMER: I wrote this library
Py-StackExchange
SEAPI
StackPy
Assuming you have registered your application and authenticated we can proceed.
First, install StackAPI (documentation):
pip install stackapi
This code will then grab the 10,000 most recent questions (max_pages * page_size) for the site hardwarerecs. Each page costs you one API hit, so the more items per page, the few API calls.
from stackapi import StackAPI
SITE = StackAPI('hardwarerecs')
SITE.page_size = 100
SITE.max_pages = 100
# Filter to only get question title and link
filter = '!BHMIbze0EQ*ved8LyoO6rNjkuLgHPR'
questions = SITE.fetch('questions', filter=filter)
In the questions variable is a dictionary that looks very similar to the API output, except that the library did all the paging for you. Your data is in questions['data'] and, in this case, contains a list of dictionaries that look like this:
[
...
{u'link': u'http://hardwarerecs.stackexchange.com/questions/29/sound-board-to-replace-a-gl2200-in-a-house-of-worship-foh-setting',
u'title': u'Sound board to replace a GL2200 in a house-of-worship FOH setting?'},
{ u'link': u'http://hardwarerecs.stackexchange.com/questions/31/passive-gps-tracker-logger',
u'title': u'Passive GPS tracker/logger'}
...
]
This result set is limited to only the title and the link because of the filter we applied. You can find the appropriate filter by adjusting what fields you want in the web UI and copying the filter field.
The hardwarerecs parameter that is passed when creating the SITE parameter is the first part of the site's domain URL. Alternatively, you can find it by looking at the api_site_parameter for your site when looking at the /sites end point.

Get notes using json read in tumblr read

In tumblr,Is there any way to get the notes using below url with custom theme page, i have check lots of blog not able to get notes or notes count
http://{name}.tumblr.com/api/read/json
Thanks
It doesn't seem like version 1 of the Tumblr API supports notes. However version 2 does:
http://api.tumblr.com/v2/blog/{name}.tumblr.com/posts/text?notes_info=true
Reference
Tumblr API v1: http://www.tumblr.com/docs/en/api/v1
Tumblr API v2: http://www.tumblr.com/docs/en/api/v2#posts

How can I add "current streak" of contributions from github to my blog?

I have a personal blog I built using rails. I want to add a section to my site that displays my current streak of github contributions. What would be the best way about doing this?
edit: for clarification, here is what I want:
just the number of days is all that is necessary for me.
Considering the GitHub API for Users doesn't yet expose that particular information (number of days for current stream of contributions), you might have to:
scrape it (extract it by reading the user's GitHub page)
As klamping mentions in his answer (upvoted), the url to scrap would be:
https://github.com/users/<username>/contributions_calendar_data
https://github.com/users/<username>/contributions
(for public repos only, though)
SherlockStd has an updated (May 2017) parsing code below:
https://github-stats.com/api/user/streak/current/:username
try projects which are using https://github.com/users/<username>/contributions_calendar_data (as listed in Marques Johansson's answer, upvoted)
IonicaBizau/git-stats:
akerl/githubchart (Github contribution SVG generator)
akerl/githubstats (Github contribution statistics)
build that graph yourself: see the GitHub project git-cal
git-cal is a simple script to view commits calendar (similar to GitHub contributions calendar) on command line.
Each block in the graph corresponds to a day and is shaded with one of the 5 possible colors, each representing relative number of commits on that day.
or establish a service that will report, each day, any new commit for that given day to a Google Calendar (using the Google Calendar API through a project like nf/streak).
You can then read that information and report it in your blog.
You can find various example of scraping that information:
github_team_calendar.py
weekend-commits.js
As in:
$.getJSON('https://github.com/users/' + location.pathname.replace(/\//g, '') + '/contributions_calendar_data', weekendWork);
leaderboard.rb:
Like:
leaderboard = members.map do |u|
user_stats = get("https://github.com/users/#{u}/contributions_calendar_data")
total = user_stats.map { |s| s[1] }.reduce(&:+)
[u, total]
end
... (you get the idea)
The URL for the plain JSON data was:
https://github.com/users/[username]/contributions_calendar_data
[Edit: Looks like this URL no longer works)
There is a URL which generates the SVG, which other answers have indicated. That is here:
https://github.com/users/[username]/contributions
Simply replace [username] with your github username in the URL and you should be able to see the chart. See other answers for more in-depth explanations
If you want something that matches the visual appearance of GitHub's chart, check out these projects which use https://github.com/users/<username>/contributions_calendar_data but also apply other factors based on Github's logic.
https://github.com/akerl/githubchart
https://github.com/akerl/githubstats
[Project deprecated and unavalaible for now, will be back online soon.]
Since the URL https://github.com/users/<username>/contributions_calendar_data don't work anymore, you have to parse the SVG from https://github.com/users/<username>/contributions.
Unfortunately, Github loves security and CORS is disabled on their server.
To solve this issue, I've setup an API for me and everyone who needs it, just GET https://github-stats.com/api/user/streak/current/{username} (CORS allowed), and you'll get and answer like:
{
"success":true,
"currentStreak": 3
}
https://github-stats.com will soon implement more stats endpoints :)
Please ask for new endpoint at https://github.com/SherloxFR/github-stats.com/issues, it will be a pleasure to find a way to implement them !