Privacy setting does not change when using Vimeo API - php

The video uploaded via the new API used the "video name" but the privacy setting doesn't change (I need it to be disabled from vimeo.com but can be embedded from other sites).
$video_data = $vimeo->request($uri, array(
'name' => 'video name',
'privacy' => array(
'view' => 'disabled',
'embed' => 'anywhere'
)
), 'PATCH');
Does anyone know why it's not working?
I find an alternative way to do this by changing the global defaul settings: https://vimeo.com/settings/videos
Many thanks

The correct request is:
// The docs refer to the following as "privacy.view"
array('privacy' => array('view' => 'disable'));
From https://github.com/vimeo/vimeo.php:
NOTE: How to use the PHP library with the Vimeo Docs.
The API docs often uses dot notation to represent a hierarchy of data (eg. privacy.view). Because this library sends all data using JSON, you must use nested associative arrays, not dot notation.

The value is "disable" not "disabled". You can see our docs here

Related

Build APP using specific keys via Phonegap Build API?

I'm trying to use Phonegap Build API.
I am using this open source PHP library to connect to the Phonegap plugin.
https://github.com/mradionov/phonegap-build-api
Everything works fine as it should.
I can add keys, upload apps and all other general tasks.
However, the issue that I currently have is that I need to be able to upload the app and build it using a specific key for each platform.
To upload the app I use this method:
$res = $api->updateApplicationFromFile(3334534, 'path/to/myapp.zip', array(
'title' => 'The APP title',
// see docs for all options
));
This uploads it correctly and as it should.
Now, i tried to upload the app using the same method but select a specific key to build it with like so:
$res = $api->updateApplicationFromFile(3334534, 'path/to/myapp.zip',
'title' => 'The APP title',
'keys' => 1435671
// see docs for all options
));
But this fails to do anything and I dont see any errors either!
Based on the Phonegap API documentation, we can send the following to the API:
keys":{"ios":123,"android":567,"winphone":72}
the numbers used are the keys/certficates that already uploaded onto the Phonegap system.
Could someone please advice on this issue?
Thanks in advance.
finally found it.
Basically I need to pass the values as an array like so:
'keys' => array("ios" => XXXXXXX, "android" => XXXXXXXX),
So the code looks like this:
$res = $api->updateApplicationFromFile(3334534, 'path/to/myapp.zip',
'title' => 'The APP title',
'keys' => array("ios" => XXXXXXX, "android" => XXXXXXXX),
// see docs for all options
));
And this works just fine...
Hoep this helps others.

Is it possible to get number of downloads of an application from Google Play?

I am trying to get the number of downloads of an application that I have uploaded to Google Play.
I am searching for an API (or something similar) that retrieves to me the number of downloads with the authentification of the user. I do not want third party applications (like AppAnnie).
It would be great if it could be on PHP and I found that there is a library which I think it is the most closest API I could find to get data from Google applications.
Google APIs Client Library for PHP
but I cannot find any mention to Google Play applications.
Is there some way to get the downloads of an specific application having the authentification keys?
Thanks in advance!
Use the google-play-scraper library to get an app information as below:
Example:
$app = $scraper->getApp('com.mojang.minecraftpe');
Result:
array (
'id' => 'com.mojang.minecraftpe',
'url' => 'https://play.google.com/store/apps/details?id=com.mojang.minecraftpe',
'image' => 'https://lh3.googleusercontent.com/30koN0eGl-LHqvUZrCj9HT4qVPQdvN508p2wuhaWUnqKeCp6nrs9QW8v6IVGvGNauA=w300',
'title' => 'Minecraft: Pocket Edition',
'author' => 'Mojang',
'author_link' => 'https://play.google.com/store/apps/developer?id=Mojang',
'categories' => array (
'Arcade',
'Creativity',
),
'price' => '$6.99',
'screenshots' => array (
'https://lh3.googleusercontent.com/VkLE0e0EDuRID6jdTE97cC8BomcDReJtZOem9Jlb14jw9O7ytAGvE-2pLqvoSJ7w3IdK=h310',
'https://lh3.googleusercontent.com/28b1vxJQe916wOaSVB4CmcnDujk8M2SNaCwqtQ4cUS0wYKYn9kCYeqxX0uyI2X-nQv0=h310',
// [...]
),
'description' => 'Our latest free update includes the Nether and all its inhabitants[...]',
'description_html' => 'Our latest free update includes the Nether and all its inhabitants[...]',
'rating' => 4.4726405143737793,
'votes' => 1136962,
'last_updated' => 'October 22, 2015',
'size' => 'Varies with device',
'downloads' => '10,000,000 - 50,000,000',
'version' => 'Varies with device',
'supported_os' => 'Varies with device',
'content_rating' => 'Everyone 10+',
'whatsnew' => 'Build, explore and survive on the go with Minecraft: Pocket Edition[...]',
'video_link' => 'https://www.youtube.com/embed/D2Z9oKTzzrM?ps=play&vq=large&rel=0&autohide=1&showinfo=0&autoplay=1',
'video_image' => 'https://i.ytimg.com/vi/D2Z9oKTzzrM/hqdefault.jpg',
)
EDIT: Easily get downloads count as below:
echo $app['downloads']; // Outputs: '10,000,000 - 50,000,000'
Or if you want the left value:
$matches = null;
$returnValue = preg_match('/.*(?= -)/', '10,000,000 - 50,000,000', $matches);
echo $matches[0]; // Outputs: '10,000,000'
Or if you want the right value:
$matches = null;
$returnValue = preg_match('/(?<=- ).*/', '10,000,000 - 50,000,000', $matches);
echo $matches[0]; // Outputs: '50,000,000'
Then easily convert it to integer using:
$count = null;
$returnValue = (int)preg_replace('/,/', '', $matches[0], -1, $count);
echo $returnValue; // Outputs: 10000000 or 50000000
This is about meta data api. You can look at below.
https://developers.google.com/android-publisher/api-ref/reviews
You need to Scrape it. Generally speaking, & of course in this particular case, when the website(here: Google Play) does not provide an API to make your(client's) desired data accessible to him, Web scraping is one of the best methods to gather your required information.
Nearly every piece of information that you can see on a web page, can be scraped. Nowadays with great improvements of web scrapers, not only you are able to grab data from a target website, but also "crawling it like a user", "posting information to website via forms", "logging in as a user" & etc. has become a routine for any web scraper.
There are very strong scrapers out there, like Scrapy(likely the most reputed one, written in Python) almost for every language. AFAIK the best web scraper in PHP, is Goutte written by legendary #fabpot from FriendsOfPHP.
From the Data-Extraction POV, Goutte supports both "CSS Selectors" & XPath (Because it uses Symfony's DOM Crawler as Crawling engine). So you can crawl the document the way you want to extract every piece of information in any hidden corner of a web page!
You can go faraway in scraping with Goutte, But just as a tiny example for grabbing "number of installs" from an ordinary App page in a blink of an eye:
use Goutte\Client;
$Client = new Client();
/**
* #var \Symfony\Component\DomCrawler\Crawler
*/
$Crawler = $Client->request('GET', "https://play.google.com/store/apps/details?id=com.somago.brainoperator&hl=en");
$numberOfInstalls = $Crawler->filter('div.details-section-contents div.meta-info')->eq(1)->filter('div.content')->eq(0)->text();
echo $numberOfInstalls;
It will simply print Brain Operator game's "number of downloads".
This project https://github.com/ArcadiaConsulting/appstorestats is a API in Java to get statistics from Google Play and AppStore
checkout this library 42 matters gives number of downloads , rating many more
With AppID you can get it from the GooglePlay API
Or if the app is yours you can export the statistics from Google Cloud (reference)
In python you can use this.
from google_play_scraper import app #if not installed google_play_scraper then install by **pip install google-play-scraper**
playstore = app('test.example.com');
print(playstore):

ALL GCM parameters?

i´ve written a "pushserver" for my app via PHP.
The push notifications i´ve sent via PHP are all received on the device, so far.
But, i can just send/set the "message" and "title", see:
$fields = array(
'registration_ids' => $registrationIDs,
'data' => array(
'message' => $message,
'title' => 'My App',
'vibrate' => 1,
'sound' => 1,
'icon' => "http://example.com/image.jpg",
"style" => "inbox"
),
);
"icon" and "style" are not working (vibrate and sound not tested, yet).
Every link for the parameters i´ve found is broken or kind of "you need to do object.setSomething() in JAVA.
Is there a list anywhere where i can see ALL parameters, which i can send to GCM? No matter, what language i use?
Cheers,
Chris
couple of things need to keep in mind while all the data which you sending from server end
Is there a list anywhere where i can see ALL parameters,
exp :- you can send as many parameters as you want but offcourse there is limitation but not key specific just like you can use "textmessage" instead of "message" but make sure to retrieve the value from same key which you are assigning from server end
1) please make sure that you are getting all the data in gcmintentservice class try to print the log of all intent data.
please remember that this is just a string data it is not going to download the image for you. you have to download using volley library or any suitable library

Is it possible to tag friends in video with graph api?

I haven't find anything related. Might be i would have searched wrongly.
I want to tag friends in video.
How do i do that using graph api in facebook?
It is possible to tag friends in a video, but it's just not in the documentation. I've searched quite some time myself to no avail, but then tried a couple of things and got it working.
The two permissions you need are publish_actions and user_videos.
It works quite similar to tagging photos, which is done with the /{photo_id}/tags endpoint. Although the video equivalent /{video_id}/tags is nowhere to be found in the documenation, it apparently does exist.
With photos you can supply the parameter tags as an array. Video tagging only supports one tag at a time with the tag_uid parameter. So if you want to tag multiple people, you'll have to do multiple posts.
This is the final working solution with the PHP SDK:
$facebook = new Facebook(array('[YOUR_APP_ID]', '[YOUR_APP_SECRET]'));
$response = $facebook->api('/me/videos', 'POST', array(
'access_token' => $facebook->getAccessToken(),
'title' => '[YOUR_TITLE]',
'description' => '[YOUR_DESCRIPTION]',
'source' => '#' . realpath('[PATH_TO_YOUR_VIDEO')
));
$facebook->api('/' . $response['id'] . '/tags', 'POST', array(
'access_token' => $facebook->getAccessToken(),
'tag_uid' => '[FRIENDS_FACEBOOK_ID]'
));
Read this
https://developers.facebook.com/docs/reference/api/post/
The post supports adding message tags.
Under the message_tags column
object containing fields whose names are the indexes to where objects are mentioned in the message field; each field in turn is an array containing an object with id, name, offset, and length fields, where length is the length, within the message field, of the object mentioned

Facebook Graph API: How to add vote links to a wall post?

I am building a Facebook app with voting included. With it I want to send a message to the user's wall including some text and two or more links.
I also want to control the link text so that I can get links like "Yes" and "No".
The first thing I tried was posting regular -tags, but (no surprise) that didn't work. I have seen other apps do this though. Are there any special tags that allow links?
Thank you.
I'll assume that you're using the Graph API and already have publish a post working.
I think the properties property might be what you are looking for (it is left out of the new API reference but is described here). This allows links although they might not be formatted quite how you want. Example:
$data = array (
'name' => ...,
'link' => ...,
'properties' => array (
'Yes' => array (
'text' => 'Vote',
'href' => 'http://www.example.com?vote=yes'
),
'No' => array (
'text' => 'Vote',
'href' => 'http://www.example.com?vote=no'
)
),
); //And whatever other properties you want
$facebook->api('/uid/feed', 'POST', $data);
The properties will appear after beneath description in the post and come out like the following:
Yes: Vote

Categories