Is it possible to set the content source of a post with Tumblr's API? - api

I find it strange that you can set nearly every property of a given post through Tumblr's API, however, I cannot seem to find how one would go about setting the content source of a post when posting through Tumblr's API.
Any thoughts? By the way, not the source of the quote post type, but rather the content source that you would if you used their GUI.

Related

Get wikitext from wikipedia API?

I'm looking at the API documentation here,
https://www.mediawiki.org/wiki/API:Query
Getting the wikitext for a page is mentioned in the beginning of the documentation,
The action=query module allows you to get information about a wiki and the data stored in it, such as the wikitext of a particular page, the links and categories of a set of pages, or the token you need to change wiki content.
but I cant seem to figure out what parameters to pass in the API request to return the wikitext for a given page. Anyone know how to do this?
I've tried parameters like,
{'action':'query', 'titles':'Anarchism', 'prop':'wikitext', 'format':'json'}
You must use this query .
https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Anarchism&rvslots=main

Posting an image on Tumblr using OAuth

I'm trying to post an image on Tumblr using OAuth. I'm using Objective C, but a general solution would be very helpful as well.
I manage to post an image that is online (using the "source" parameter). However, I can't post an image from the client (using the "data" parameter), and some issues confuse me.
1) Should I use "multipart/form-data" or "application/x-www-form-urlencoded"? I've seen conflicting claims on this issue.
2) What should I put in my post body and what should I put in my basestring? According to the oAuth specifications, if I use "multipart/form-data" then I don't need to add the parameters that I add to the post body (like "type" and "caption") to the base string, but even when I succeeded posting with "source", it only worked if I added the parameters to the base string as well.
3) In what format should I add the image to the body? If I need to also add it to the base string, then in what format should I add it there?
Thanks!
The problem with Tumblr is "unusual" implementation of OAuth (OAuth issues). It's not likely to be possible with "old" OAuth (from code.google.com/p/oauth/). I myself ended up using one of these solutions: crossbreeding OAuth with ASIFormDataRequest, but it is not likely to work with multiple images, or integrating TumblrUploadr. Also, Tumblr is likely to work better with new OAuth library (from here)
, but it will definitely conflict with ShareKit if you use it.
Concerning your questions:
TumblrUploadr uses application/x-www-form-urlencoded so it
is likely to be this one.
With any of solutions above, you should
just pass UIImageJPEGRepresentation of your image. TumblrUploadr has
it's own URL-encoding and for ASIFormDataRequest, I'm not sure.
URL-encoded binary data, as it is said in Tumblr API. I myself
didn't investigate ASIFormDataRequest deeply, so I'm not sure if you
need to add it to base string.

Graph API not returning image/picture for community pages

Graph API is not returning image("picture" attribute) for objects corresponding to community pages, which used to be returned earlier. For example this https://graph.facebook.com/178790412179919 does not have picture attribute whereas the corresponding page has an image.
Also the FQL query done on the "albums" connection for some objects does not have a "cover_pid" attribute for an album corresponding to type "profile", which again used to work earlier.
Does anybody know if anything has changed in Graph API corresponding to this in last couple of weeks (I am fairly confident it used to work earlier in the expected way). I looked through Facebook API release notes but could not find any changes corresponding to this. Please let me know if this not appropriate post for this forum.
https://developers.facebook.com/docs/reference/api/page/
picture is a connection, not an attribute. So ...
https://graph.facebook.com/178790412179919/picture
And as the docs say: Returns a HTTP 302 with the URL of the user's profile picture.
Kinda goofy? Yes, but it works exactly as the docs say it does. I suspect they implemented it this way so it could easily be used in an <IMG> tag.
UPDATE:
It still works via FQL. In your case:
https://api.facebook.com/method/fql.query?query=SELECT+page_id%2C+pic+FROM+page+WHERE+page_id+%3D+178790412179919&format=json
I can confirm that this PREVIOUSLY worked, but NO LONGER works. Facebook have removed the picture connection from Community Pages.
I suspect the reason is that most of these images are pulled from Wikipedia, and there was a licensing / attribution issue.
Unfortunately, Facebook is no longer a reliable source of images for entities (e.g. bands).

Spotify API get Related Artists

Is there a way to get a list of related artists through the spotify api. Like the small list that displays in the actual program?
Would be very useful if so, but I am not so sure
Cheers
Yes, it's available through libspotify. There's a SPArtistBrowse class that contains a lot of metadata, including the related artists. Check out the
CocoaLibSpotify comes with a documentation package, where you can find more details on what's included: https://github.com/spotify/cocoalibspotify.
Do note that it's currently extremely slow to load an entire SPArtistBrowse object. I'm assuming it's got something to do with libspotify loading it all in one chunk and on the main thread (?). From what I know, Spotify are suppose to remedy that in an upcoming version of libspotify, though.
Get an artist's related artists is now available through the Spotify Web API.
GET https://api.spotify.com/v1/artists/{id}/related-artists is the format.
https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE/related-artists is an example request.
For more information, see the API documentation.
There is also a JSFiddle demo app.
Definitely! All you need is the "artist_id" and the SpotifyPublicAPI can return a list of the related artists. You don't need an access_token at all.
You can easily test the API call here on RapidAPI. I've specifically linked you to the getArtistsRelatedArtists endpoint. Rapid will provide you with a code snippet you can copy and paste directly into your code to make the call.
Here is an example testing the API call using Beyonce's artist_id:
Here is a sample code snippet provided by RapidAPI wth Beyonce's artist_id passed as a parameter:

Adding a photo collection using the flickr API

Is it possible to create a photo collection using the flickr API?
I haven't found any example code to achieve this, however you CAN do it on the flickr website, and i suppose flickr uses the API internally for their site?
Dennis
This may be too late to help but, I thought I'd post the solution here for posterity (as this post came up while i was google'ing for the answer before i discovered it).
The method is undocumented in the Flickr API but, it does seem to work (tested via the REST interface).
The method is: flickr.collections.create
Required parameters:
auth_token
api_sig
title (Example value: "My Awesome Title Here.")
Optional parameters:
api_key
auth_hash
cb
description (Example value: "My Awesome Description Here")
parent_id (Example Value: 0)
src (Example: "js")
I found the method by enabling Firebug's console while creating a collection in the Flickr web interface and examining the POST. I have no idea what auth_hash nor cb refer to but, I would assume that they are required while using the JavaScript interface as opposed to REST.
Anything that uses the JavaScript interface on Flickr can be reverse engineered by examining the POST that occurs immediately after you take the action in the web interface.
Official support for the "flickr.collections.*" portion of the Flickr API has indeed been delayed for some reason (since at least 4/2007). There is a discussion thread over on Flickr, with a bit more information (reverse engineering) on the undocumented API.
Yes, you can. But, first you need to specify so-called 'primary photo'.
This means that flickr doesn't allow you to create empty albums (collections). I don't know why they decided to restrict creation of empty collections but it's a fact.