I'm using the google-api-php-client (https://github.com/google/google-api-php-client) to search and retrieve only videos from YouTube. I know you can set a query marker called type to video like this:
$searchquery = array(
'q' => "flux",
'maxResults' => 10,
'type' => 'video',
'videoDuration' => 'short',
'videoEmbeddable' => 'true'
);
However it seems to also return live events/livestreams in the search results. Is there a way to exclude live event videos? They have a marker called [liveBroadcastContent] => upcoming so I can do post-search but that's not ideal. Thanks in advance.
edit: on closer inspection, not all livestreams even seem to have the marker [liveBroadcastContent] set. I have found some that are set to none as with ordinary videos.
Related
i need to send custom filter to google adsense api v2
something like this
$optParams = array(
'filters' => array(
"URL_CHANNEL_NAME=#https://example.com/test/*"
//or "URL_CHANNEL_NAME==https://example.com/test/"
)
);
to get only earnings for this url "https://example.com/test" or "https://example.com/test/*"
i have tried "URL_CHANNEL_NAME==https://example.com/test/" or even "URL_CHANNEL_NAME==https://example.com/test/" but reponse always null
enter image description here
You can use regex to target all channels that begin with a certain URL
$optParams = [
'filters' => [
'URL_CHANNEL_NAME=#^https://example\.com/test'
]
);
There is also "contains" but "contains" with URLs can in edge-case scenarios return undesirable results:
URL_CHANNEL_NAME#https://example.com/test
It also could just have no data for the date range you're using, you won't receive anything if that is the case.
I am using the mgp25 Instagram API and have the following question,
I want to tag/mention a user within a story. I can easily now make hashtags or add a link to a story with this API, but from the examples and source code I cannot get the concrete code about tagging/mentioning a user in a story like a sticker:
Picture of user mentioning / tagging via Instagram story
I opened already an issue at the GitHub:
https://github.com/mgp25/Instagram-API/issues/1826
This is the code I created from existing source code from the API and from examples, but there is no concrete example for this use case, and it doesn't work:
'story_mentions' =>
[
'user_id' => '123456789',
'x' => 0.5,
'y' => 0.5,
'width' => 0.5661107,
'height' => 0.10647108,
'rotation' => 0.0,
'is_sticker' => true, // Don't change this value.
],
Maybe someone has an Idea or implemented it already, furthermore, the example of the location sticker doesn't work as well :/
Thanks and kind regards!
I am a Vimeo Pro user with my videos set to private so they can only be viewed via a specific IP address. I have created a front end application for displaying only my videos which includes a search function using the Vimeo API.
The search successfully returns my videos based upon their title but will not search my videos’ tags or description. I am using the following PHP code along with Vimeo’s PHP library:
$query = 'search term';
$vimeo = new Vimeo\Vimeo($app_id, $app_secret, $token);
//get the video list
$args = array(
'per_page' => 5, // 50 is the max
'page' => $page,
'query' => $query,
'sort' => $sort,
'direction' => 'desc',
'filter' => 'CC'
);
$results = $vimeo->request('/me/videos', $args);
I need to be able to search via tags and description to make my application viable.
Does anyone know a solution or is this not possible?
Thanks in advance
The default on site search does not search through private videos. Because of this, we offer a less powerful search for Private PRO users. This search does not support description or tags.
We plan on expanding our more powerful search system, but I can not assure a timeframe.
Your best bet at the moment is to index the data in your own search service (such as solr or elasticsearch).
I hope you will be able to help me.
I'm developing an app, and I'm willing to post an activity (that appears on user timeline in recent activity) everytime the user use my application.
Although, for the moment, I have this code below, and it only posts a normal link :
if($can_post){
$facebook->api('/'.$uid.'/feed', 'post', array(
'message' => '',
'name' => 'Name',
'caption' => 'Caption',
'description' => 'SDesc',
'picture' => 'picture url',
'link' => 'link',
'actions' => array(array('name' => 'catch phrase',
'link' => 'http://link'))
));
Check out this guide on posting "stories" to the user's timeline using the Open Graph API, so maybe it's this functionality that you need. The example they give is just a like, but it can be easily modified.
Be aware that Facebook will have to approve you app again if you want to use stories (see end of page on link above).
It's also worth noting that Facebook have also defined a wide range of predefined "Actions" to help in the process, so it's a good idea to check to see if your app falls into one of these categories.
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