Is the list of cities that can be set for current city or hometown available? - facebook-graph-api

It doesn't look like the input that FB uses for current city and hometown is available as a widget or dialog for developers to use. I'd like to create an autocomplete input field that uses the same names for cities and the corresponding ID's. There's the lists of the cities that FB publishes for post and ad targeting but that is incomplete and appears to be using a different ID space; I'd like the same cities and IDs that are available to users when they edit their current city on their profile. Using jquery to do the autocomplete part is doable but I just can't find an API or data source available to populate it.
Does anybody know how to access that data from the graph API, fql or any other Facebook sanctioned means?

I havn't seen a graph api or fql method for this. The best I have seen from Facebook is this list: https://www.facebook.com/ads/api/autocomplete_data.php which you would want to parse and cache the json since its a pretty big download. If you needed more details about the location, you could call the graph api by the id provided in that file.

Related

Facebook Graph API Search Posts for specific text in message field

Is there a way with graph facebook to search specific text content in the message of a user's posts? The assumption here is that the user id and access token is already available as well as all applicable permissions (ie. the user_posts permissions, etc..).
I read through the search feature on graph:
Facebook Graph Docs-Advanced
The following graph explorer example was provided:
GET graph.facebook.com/search?
q={your-query}&
type={object-type}
The table that lists the available types in the link provided is very limited (place, placetopic, ad_*). Is that the full list of possible types? Can we use POSTS or user posts as a type. I couldn't find the right syntax anywhere.
My goal is to retrieve a user's posts based on a specific message tag or text in their post message. Currently, the only way I know how to do this is highly inefficient. I would have to do the following:
Get user's full list of posts
https://graph/facebook/com/{version}/{userID}/?fields=posts&access_token={token}
Run a coded query to get the posts I need and discard the rest
Thanks in advance.

is there any way to get category of instagram business account from graph api?

i want get some information about Instagram business account from graph api. but i don't find any way to know about category of account. this code give me some information but not about category.
{ig_id}?fields=business_discovery.username({username}){Bbiography,followers_count,follows_count,media_count,website}
thank for your help
That does not seem to be possible.
https://developers.facebook.com/docs/instagram-api/reference/user/#returnable-fields lists all the available fields you can request for an IG User object - and any sort of category is not one of them.

Saving Data To Sitecore Analytics From Custom Code

I have been using Sitecore for a couple of years, and now looking to begin utilizing the Experience functionality found in Sitecore 8.
I have a view that will capture some user-provided data. How do I go about creating a "person" (don't know the correct Sitecore terminology) in the Analytics database from custom code.
You'll need to create a Contact. Contacts are a kind of profile store for xDb and allows you to store data about your visitors. A contact has a built in list of facets (email, phone number, name etc) that make up the contact record, but it's also possible to create your own facets.
If you are building a form to capture data you can use the new Tracker api to identify and update facets on a contact.
Here's some code to do this:
https://github.com/ianjohngraham/CoreBlimey.Utils/blob/master/CoreBlimey.Utils/xDB%20Contact%20Creator/CreateContact.aspx.cs
There's a walk through of how the code fits together here:
https://m.youtube.com/watch?v=Jq6TpMgUGAk
(Apologies for the sound quality)
Also if you are using the WFFM module in Sitecore 8 there are some new save actions that will create contacts and store xDB data.
You may want to spend time on the docs. Please refer here for articles and guides related to Personalization and Personas.
Most of the configuration can be specified in Experience Analytics within Sitecore and you can leverage Rules Engine to perform actions.

Obtaining the location of places on facebook and integrating it into window phone app

I am trying to obtain information of a users current location I already have the users latitude and longitude what I want to know is are there any businesses (restaurants, clothing stores ect.) in that area. I was just looking at the open graph api and It says that you can search over all public objects in the social graph with https://graph.facebook.com/search. We support searchs for the following types of objects: places https://graph.facebook.com/search?q=coffee&type=place but the ones I really want to use type=location&center=37.76,-122.427&distance=1000 does not work in the API Explorer could anyone tell me what might be the problem and how do I use this in a windows phone 7 app? Links, code snippets, blog post, ebooks, Other web services that would allow me I could send lat and long and will return the location or businesses anything will be very helpfull thanks
https://graph.facebook.com/search?q=coffee&type=place&center=37.76,-122.427&distance=1000
This query should give you the results you need.

Can I have my app scan my Twitter stream for news to show the user?

I would like to be able to show short news messages to users of my app. I am thinking the nicest way to do this would be to add a hashtag (like #appnews) to my Twitter updates that I want shown in-app; my app will make this happen by scanning my Twitter stream at startup and surfacing updates with that hashtag. This seems super-simple, and I'd like to know if there's some way to do this via built-in (HTTP?) calls to my Twitter page, rather than incorporating a whole framework like MGTwitterEngine. The user will not be logging in or posting Twitter updates at any point.
Thanks!
You can retrieve any user's public tweets in XML format by retrieving the following URL:
http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=DWRoelands
(This example will display my tweets). Once you've got the list of tweets, you can parse through the XML document in whatever way is easiest for you.
Rather than tagging posts with a hash tag, I would recommend simply starting a new Twitter account that is solely for the news items you described.