Is there a possible way where I can retrieve a list (with thumbnails) of my latest videos from youtube, store the embed code in a database using a cron job so I can show the video on a separate page instead of leading the users to youtube to view the videos? (all in php)
you can try to have a look at this page: https://developers.google.com/youtube/v3/
Google writes that:
You can use the API to fetch search results and to retrieve, insert, update, and delete resources like videos or playlists.
I saw thath PHP API are still in beta version but you can try it out. You must register your application to obtain credential to use API. At developers.google there is a lot of documentation and some examples (https://developers.google.com/youtube/v3/code_samples/php#retrieve_my_uploads)
Using API you don't need to retrieve code and store it into database, you can just show videos directly in your web application. I hope this is what you was looking for let me know if it helps!
Luca
Related
I have a professional website using Google Analytics for metrics and I try to automatize one task I used to do manually but.. not able to understand if it's possible ?!
I just began to using the Google PHP client library to access the Google Analytics API on my website Test with the HelloAnalytics.php file is OK, I manage to connect and retrieve my data.
What i'm trying to do is :
Get all URLs viewed in the past 24H (what you can see when you navigate in the GA dashboard -> Behavior -> Site content -> All pages)
Combine those datas with my custom Definition which is in fact a special token i generate for every users on my website via PHP, then send it thought with Javascript and ga('set', 'mycustomdefinition', 'my token');
Is it possible ?
Many thanks in advance for your support !
Data under 24-48 hours old has probably not completed processing so I recommend not looking at data viewed in the last 24 hours it wont be correct. Other wise yes you can see this.
Assuming you mean custom Dimension yes you can extract custom dimensions and the page path in the same request.
You might want to have a look at the Dimensions & metrics explorer as well as the google analytics query explorer both will help you understand what data can be extracted from the API.
I know it's super easy to retrieve photos from Instagram according to a specific hashtag from your own profile (with the client id used in the connection to the library), but I could not find anything official to retrieve photos with an hashtag, independently by the users.
So, for instance, if my hashtag was test, an API grabbing a PHP object containing photos as in this link as in the following code
$o_instagram = new Instagram($s_client_id);
$o_media = $o_instagram->searchTags($s_hashtag);
Any ideas or suggestions? Thanks in advance.
have a look at the following endpoint
https://instagram.com/developer/endpoints/tags/#get_tags_media_recent
I'm not sure how it looks in their php library but in ruby is is something along the lines of Instagram_client.tag_recent_media(:tag)
It's paginated in order of most recent first
I have search a lot on this site and google to get the last login date and time of a particular facebook user from user id using the graph explorer. However, could not find a relevant article.
I have 20+ employees working in my office and I do not want them to access facebook during shift timings. I have their user ids with me. Is it possible to check when did they last login/logout or performed any activity on facebook using their FB UIDs using a php/mysql or any other way or just by using the graph explorer?
I read some articles that had fql options but i could not try those as fql is depreciated. Any help here would be appreciated.
Thanks
Did you meant to use a Graph or Graphic ?
Using a table to log-in when your users accessed Facebook will be simpler.
You'll have to apply a filter to remove results outside the shift timings.
Once you are done with it, creating a bar graphic will be an easy solution.
If you want to use the Graph API, you need to make sure that your employees log-on onto your application and give their consent.
You should check : https://developers.facebook.com/policy before trying anything.
Only use our SDKs to develop and distribute apps for use with the
Facebook Platform. You may also distribute any code libraries or
sample source code included in the SDKs for inclusion in such apps.
Use simple network functions like logs to collect data.
Enabling a Firewall is better than making Facebook accessible in those shift hours.
If you meant Graph API, it's a social graph explorer. It's meant to show all the relations between the users. I am not sure how far it deviates from a graph, neither if it has some visualization capabilities.
Using the Graph API to monitor your workers might be a grave legal infringement. There are many laws protecting privacy at work. The Graph API can give all kind of information. I would not suggest to use any kind of solution that gives access to some sensitive data...
Logging all the Connections going to FB would be the only choice.
I need to create a program which allows to store photos of which people has uploaded in Facebook based on the photo description. For example, I upload/post on Facebook a picture with the description "#awesomeevent" the program should be able to store this particular image into the database. Twitter has hashtags but Facebook do not any where which i can work around this ?
I was thinking of using a FQL query but unsure how to do it.
The best (and only?) way to do this imho is to include the hashtag in the message of the photos and read it from there. I would not use FQL for that, because there is no need to use it. The Graph API offers enough possibilities/connections to read photos:
https://developers.facebook.com/docs/reference/api/user/
(/me/photos, /me/photos/uploaded, /me/albums, ...)
I'm putting together an application in facebook, part of which requires a user to input a bunch of information into a form, including a video and a number of text fields.
For my application, I'm using a combination of HTML, PHP, mySQL and Javascript.
I want to be able to upload the users video file to facebook using the PHP SDK in the same page as I am inserting their info into my database. I want something similiar to the photo solution here: Exception when uploading photo with Facebook Graph API. But I'm not sure what the array key should be for the video itself.
Can any give me any ideas?
My apologies,
I realized that the solution I linked to works. However, you have to give facebook time to process the video, otherwise the graph api replies false.