Statistics for Facebook Event - events

I'm trying to pull back impressions about a Facebook event, but haven't been able to find much documented. With the REST API, I was able to do an FQL call with something like this:
SELECT post_id, impressions FROM stream WHERE source_id=(page_id) AND attachment.fb_object_id=(event_object_id)
However, now that I'm changing to the Graph API, that FQL query no longer returns results.
Any help would be much appreciated
Thanks!

You can use the Graph API here for retrieving the likes, feeds, links, posts, statuses, invited, videos, pictures at http://developers.facebook.com/docs/reference/api/event/
But its not possible to get the complete stats for a event in one query. You will have to calculate it separately step by step.

Related

GraphQL query for only unseen content - Schema Advice

I'm building a graphql schema through AWS AppSync and have a question regarding schema structure. My app will show users new posts and have them either join or pass on them. I'm trying to build in a way that I will only show users new posts and not repeat or at least not repeat for a certain amount of time. It's similar to swiping on tinder, they don't show you somebody again if you've already swiped on them. Does anybody have any ideas how to structure this in my schema. Do I need to store references to all of the seen posts in the user model or should I store each swipe as its own model and how should I structure the querying? I'd appreciate any advice on this.
Thanks!
Assuming a post has a creation time, you could keep track of the last (max created time) post they've seen, then display anything after that.
But think about what happens if they've been off the app for 5 minutes, or 5 days, or 5 weeks... depending on the volume of posts you anticipate they could quickly get behind and have to wade through too many older posts.
One thought would be to show the next oldest post, based derived from the creation time of the most recent post they viewed. Unless N number of posts were created since the last time they were online (a threshold you'd have to decide). Then start with displaying the N - Xth post (where X is 5, or 500, again depending on volume) until they're all caught up.
There are lots of ways you could program it, it all depends on your use case, you may want to take "popular" posts into account for example, those might be weighted above/before the other posts in their backlog.
Hope this helped.

Square v2 API - Questions on filtering

When we wrote or initial integration for Square v1 API, there wasn't an option to filter ListOrders by Date
Our questions for v2 api:
In v2, looks like all transactions are housed under the same endpoint.
Okay, we call GET /transactions
How do we tell what is an order vs. payment vs. refund in the response?
not all payments are generated off an order. For example, I can do one-off Square transactions on my phone for walk-up customers, which would not have an order associated with it)
Can we filter for orders only?
Does the Transaction endpoint supports date filtering now?
Thank you for your time
Take a look at the documentation for the v2 Transaction object. Refunds and orders are subsets of that object.
Also look at the documentation for the List Transactions where you can see that you can currently filter based on times only right now.
If it isn't listed in the documentation, then it probably isn't supported.

YouTube data Api for videos under particular category

I am trying to fetch the 25 each videos under particular category, but i am struggle to form YouTube data API, can anyone help me to form.
I have got category list using categories API, but i am struggle to fetch videos of particular category.
You need to use the Videos List API
with the parameters chart=mostPopular and videoCategoryId=<id>
for example
https://www.googleapis.com/youtube/v3/videos?part=snippet&chart=mostPopular&videoCategoryId=10&key={YOUR_API_KEY}

Possible to search for transactions by 'escrow_status' with Braintree API?

I'd like to search for transactions associated with my merchant_id, which have a certain escrow status. Something along these lines:
collection = braintree.Transaction.search(
braintree.TransactionSearch.escrow_status == 'hold_pending'
)
Is there a way to accomplish this?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact our support team.
Searching for transactions based on escrow_status is not supported by our api at this time. A workaround is to collect all transactions for a particular time period and manually filter these based on escrow status.

Add pivot-table to a google spreadsheet, via the API

I'd like to automatically create one of these pivot tables:
https://drive.googleblog.com/2011/05/summarize-your-data-with-pivot-tables.html
Given some data and parameters, the script would create a new google spreadsheet, complete with pivot-table and chart, non-interactively.
Is this possible?
It appears that there is a partial answer. I haven't tried it yet, and I wouldn't swear by it till I do. If anyone does try this technique, post here.

Resources