How to get feeds of facebook using simple facebook? - android-simple-facebook

I am trying to get all the feeds of facebook id. I got all the feeds using graph explorer tools but when I use simple facebook 2.0 in android, I didn't get all feeds but few.
`String entityId = "me";
String edge = "feed";
//Bundle params = new Bundle();
//params.putString("fields", "feed");
simpleFacebook.get(entityId, edge, null, onActionListener);`
Above code is my part of simple facebook code.
I want the result that is similar to the result of me?fields=feed. How can I get the result? I don't want to use facebook SDK 3.15.0.
Your help is highly appreciated.

Use getPosts() method:
String entityId = ...;
mSimpleFacebook.getPosts(entityId, PostType.ALL, onPostsListener);
You can filter by:
PostType.ALL - Everything that was published (links, statuses, photos...) that appears on the users' wall. (uses graph path: *{entityId}/feed)
PostType.LINKS - Link published by the entity. (uses graph path: {entityId}/links)
PostType.POSTS - Posts published by the entity. (uses graph path: {entityId}/posts)
PostType.STATUSES - Status update posts published by the entity. (uses graph path: {entityId}/statuses)
PostType.TAGGED - Posts in which the person is tagged. (uses graph path: {entityId}/tagged)

Related

Trello API: Get all Cards assigned to a user, on a specific board

I'm trying to get all cards in a board assigned to a specific user, but the below returns all the cards in a board.
I did not find this solution anywhere; this is what I tried, and it returns cards assigned to all users:
https://api.trello.com/1/boards/${boardid}/cards?fields=name,shortLink&key=${applicationkey}&token=${userkey}
${boardid} = id of the board I want cards from
${applicationkey} = Trello Developer API Key
${userkey} = Trello User Token
Looks like a lot of people were able to do this, but there is no working documentation on this one.
I was able to accomplish this (get all cards assigned to me), by using the Trello search API.
Query URL (Cards assigned to a member):
https://api.trello.com/1/search?query=label:green%20member:${memberid}%20board:${boardname}%20sort:edited&card_fields=name,shortLink&cards_limit=100&key=${applicationkey}&token=${userkey}
Query Pattern (regexp to read cards):
"name":"({Description}.+?)","shortLink":"({Id}.+?)"
Parameters used:
${applicationkey} = Developer API Key
${userkey} = User Token
${boardname} = Actual name of the board in Trello
${memberid} = member id of the Trello user
Get Developer API key and User Token: Click here
Get member id from here:
https://api.trello.com/1/search?query=is:open%20board:${boardname}%20sort:edited&card_fields=name,shortLink,member&cards_limit=100&key=APIKey&token=UserToken

Bloomberg API: Search for a company and return all associated tickers

I'm programming using the Bloomberg API. I need to be able to search for a company and get a list fo all tickers associated with that company. I'm working with .net version.
Can anyone please direct me to what sort of request I need to make?
You might be looking for the //blp/instruments service.
In the SDK this is documented as the SecurityLookupExample.
You can create an instrumentListRequest along the lines of:
InstrumentListRequest = {
query = "IBM"
yellowKeyFilter = YK_FILTER_NONE
languageOverride = LANG_OVERRIDE_NONE
maxResults = 10
}
This will return a list of instruments like "IBM US Equity", "DD103619 Corp", "IBM UN Equity", etc.

Can we extract all Visitor ID's from Adobe Analytics using API

I'm looking to determine whether it's possible via visitor API to be able to find out all visitor ID's.
In the code examples below, [your mcorgid here] is your company's marketing cloud organization id. If you do not know this then you need to contact Adobe Client Care to get it.
getMarketingCloudVisitorID - Get the Marketing Cloud Visitor ID (mid= param)
var visitor = Visitor.getInstance("[your mcorgid here]#AdobeOrg")
var mcvid = visitor.getMarketingCloudVisitorID();
getAnalytcisVisitorID - get legacy visitor id (aid= if applicable)
var visitor = Visitor.getInstance("[your mcorgid here]#AdobeOrg")
var aid = visitor.getAnalyticsVisitorID();
getCustomerIDs - get all customer IDs
var visitor = Visitor.getInstance("[your mcorgid here]#AdobeOrg");
var customerIDs = visitor.getCustomerIDs();
s_fid - Fallback ID
There is no built-in method for retrieving this, but you can use AA's s.c_r() cookie reading utility function, or any other cookie reading method you have to look for the s_fid cookie. (sidenote: I do not recommend using DTM's _satellite.readCookie()method. It only looks for cookies on the current page's full (not root) domain, and there is no way to change that. Since AA and most other things usually set on root domain, it makes _satellite.readCookie() unreliable in practice).
var fid = s.c_r('s_fid');
Use Adobe datawarehouse and extract Experience Cloud ID. Assuming you know how to use the API already, here is an easy report to try
report_definition = ReportDefinition(
dimensions="marketingcloudvisitorid",
metrics="visits",
date_from=insertdate,
date_to=insertdate,
source="warehouse"
)

Get a list of all artists from Soundcloud

Is there any way of getting a list of all artists who are presented on Soundcloud ( via it`s API or by some other means) ?
Here is a bit of code which should point you in the right direction.
Problem could be the response limit, which is 200.
That's why you have to store the responses anywhere to get a full list of all artists (users) on SC.
To get a list of users you can do the following by using the SC JS SDK.
May be you can play around with the q parameter.
JS Code:
SC.initialize({ client_id: "201b55a1a16e7c0a122d112590b32e4a"});
SC.get('/users', { limit: 200}, function(users) { console.log(users);});
Example here:
http://jsfiddle.net/iambnz/9kUwq/
Docs:
http://developers.soundcloud.com/docs/api/guide#search
http://developers.soundcloud.com/docs/api/reference#users

RESTful API - How do I return different results for the same resource?

Question
How do I return different results for the same resource?
Details
I have been searching for some time now about the proper way to build a RESTful API. Tons of great information out there. Now I am actually trying to apply this to my website and have run into a few snags. I found a few suggestions that said to base the resources on your database as a starting point, considering your database should be structured decently. Here is my scenario:
My Site:
Here is a little information about my website and the purpose of the API
We are creating a site that allows people to play games. The API is supposed to allow other developers to build their own games and use our backend to collect user information and store it.
Scenario 1:
We have a players database that stores all player data. A developer needs to select this data based on either a user_id (person who owns the player data) or a game_id (the game that collected the data).
Resource
http://site.com/api/players
Issue:
If the developer calls my resource using GET they will receive a list of players. Since there are multiple developers using this system they must specify some ID by which to select all the players. This is where I find a problem. I want the developer to be able to specify two kinds of ID's. They can select all players by user_id or by game_id.
How do you handle this?
Do I need two separate resources?
Lets say you have a controller name 'Players', then you'll have 2 methods:
function user_get(){
//get id from request and do something
}
function game_get(){
//get id from request and do something
}
now the url will look like: http://site.com/api/players/user/333, http://site.com/api/players/game/333
player is the controller.
user/game are the action
If you use phil sturgeon's framework, you'll do that but the url will look like:
http://site.com/api/players/user/id/333, http://site.com/api/players/game/id/333
and then you get the id using : $this->get('id');
You can limit the results by specifying querystring parameters, i.e:
http://site.com/api/players?id=123
http://site.com/api/players?name=Paolo
use phil's REST Server library: https://github.com/philsturgeon/codeigniter-restserver
I use this library in a product environment using oauth, and api key generation. You would create a api controller, and define methods for each of the requests you want. In my case i created an entirely seperate codeigniter instance and just wrote my models as i needed them.
You can also use this REST library to insert data, its all in his documentation..
Here is a video Phil threw together on the basics back in 2011..
http://philsturgeon.co.uk/blog/2011/03/video-set-up-a-rest-api-with-codeigniter
It should go noted, that RESTful URLs mean using plural/singular wording e.g; player = singular, players = all or more than one, games|game etc..
this will allow you to do things like this in your controller
//users method_get is the http req type.. you could use post, or put as well.
public function players_get(){
//query db for players, pass back data
}
Your API Request URL would be something like:
http://api.example.com/players/format/[csv|json|xml|html|php]
this would return a json object of all the users based on your query in your model.
OR
public function player_get($id = false, $game = false){
//if $game_id isset, search by game_id
//query db for a specific player, pass back data
}
Your API Request URL would be something like:
http://api.example.com/player/game/1/format/[csv|json|xml|html|php]
OR
public function playerGames_get($id){
//query db for a specific players games based on $userid
}
Your API Request URL would be something like:
http://api.example.com/playerGames/1/format/[csv|json|xml|html|php]