How would I update the title of a YouTube livebroadcast via a Bash script? - bash

I have a YouTube channel that has a number of live broadcasts throughout the week, I am just looking for a way for the Title and Description to be updated via a crontab.
I have see seen the following link. https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/update
To be honest I cant make any sense of it.
Any help offered greatly appreciated.

You're in front of a non-trivial API, but that should not discourage you to go ahead with it.
I'd recommend Python as implementation language: go use the Google's APIs Client Library for Python.
Basically, this library is of good quality and (compared to other client libraries) simple to use. It will, for example, insulate you from having to deal explicitly with REST API calls, JSON and the like. Your code will also work under both GNU/Linux and Windows.
You may begin your journey by reading the official getting started docs: Python Quickstart and YouTube Live Streaming API Overview. Then I recommend absorbing these two important documents: Life of a Broadcast and Understanding Broadcasts and Streams.
Then go read, understand and run the following sample program from Google: create_broadcast.py. Of course, you'll have to adapt that code to your use case.
You'll have to exercise patience and perseverance (since I imply that you have no prior experience using the YouTube Data API). Using this API will pay off to you at the end of your (programming) journey.
A special mention: for to be able to call the live streaming APIs you will first need to get acquainted with the things related to the so-called OAuth 2.0 authorization and authentication: Implementing OAuth 2.0 Authentication. There's an official document that you need absorb: OAuth 2.0 for Mobile & Desktop Apps.
A few more references: the live streaming API has an official documentation too. The main site documenting the client library is: Google API Client Library for Python Docs. Its source is public, to be found within the client library's public repo under the directory docs.
Also useful is to see the YouTube Data API's list of all instance methods.

Related

Can Dexie syncable be used with an api server vs directly with a database

I have seen the sample projects on your website for Dexie.Syncable such as sync-server and sync-client and they all seem to write to a datbase directly vs interacting with a web api. I am looking for a little help in where to get started beyond the examples on the website. The api I am trying to write a gateway for is dreamfactory
Also it looks like version 2 beta has had many improvements to Dexie.Syncable
I would recommend to build a new server-project based on either WebSocketSyncServer.js or the github repo of sync-server. However, I cannot give the details on how to call REST APIs instead of working directly towards database or memory. I would suggest using ES2016 async/await since your API calls are asynchronic.
Maybe you could try getting more help on https://github.com/nponiros/sync_server by filing an issue there.

Whether to use googleapis or google-cloud library for node js

I see there are two available libraries. I am wondering what are the differences? Are they both officially maintained by Google?
https://www.npmjs.com/package/googleapis
https://www.npmjs.com/package/google-cloud
Yes both are maintained by Google. googleapis covers all these APIs (drive, calendar, admin sdk, maps, etc) whereas google-cloud covers the cloud platform stuff like bigquery, datastore, cloud storage, bigtable, pub/sub, etc. There appears to be overlap and I don't know which one is better for a particular service. Will be playing with cloud storage and admin sdk here soon though :)
The answer is found here.
From the reference, the #google-cloud library is recommended as it has the following benefits:
In some cases, gives you performance benefits by using gRPC. You can find out more in the gRPC APIs section below.
#googleapis " has autogenerated interface code that may not be as idiomatic as our newer libraries."
Personally, I think if you are using non-cloud APIs like Gmail, Calendar, etc, it may be more worth it to use just the Google APIs library for syntactic consistency.
One thing I noticed is that the #google-cloud library didn't allow the same authentication method that I like using with #googleapis:
const { google } = require('googleapis');
new google.auth.JWT(client_email, null, private_key, [
'https://www.googleapis.com/auth/cloud-platform'
]);

the geo coder to fetch more requests

I am working with geocoder gem and like to process more number of requests from an IP. By default Google API provides only 2500 requests per day.
Please share your thoughts on how I can do more requests than the limit?
As stated before: Using only Google API the only way around the limitation is to pay for it. Or in a more shady way make the requests form more than one IP/API-Key which i would not recommend.
But to stay on the save side i would suggest mixing the services up since there a few more Geocoding APIs out there - for free.
With the right gem mixing them is also not a big issue:
http://www.rubygeocoder.com/
Supports a couple of them with a nice interface. You would pretty much only have to add some rate-limiting counters making sure you stay within the limits of each provider.
Or go the heavy way of implementing your own geocoding. With for example your own running Openstreetmaps database. The Database can be downloaded here: http://wiki.openstreetmap.org/wiki/Planet.osm#Worldwide_data
Which is the best way depends on what your actual requirements are and what ressources you have available.

What is the simplest way for me to use Google's APIs?

Currently, I'm trying to get a list of advertisers (See http://code.google.com/apis/gan/v1beta1/advertisers/list.html) with my relationship status from Google's API.
I'm using Ruby and the 'google-api-client' gem and I'm writing this as an automated task. I've suddenly been thrust in to their world of browser windows, shell scripts, and every nut and bolt of OAuth2. I think I'm using the solution for a much different problem - accessing the data of people coming to your website. I just want MY data. Surely there's a much simpler way for me to get it?
Many other affiliate networks give me a REST service (or butchering thereof) and secret params/headers for auth.
I've registered myself as user of my 'device'. My app can now access my data!
I followed the instructions here:
https://code.google.com/apis/accounts/docs/OAuth2ForDevices.html
Is this the correct/best way to do it? I am unsure.

Google Visualization API

I want a real and honest opinion what do you think of Google Visualization API?
Is it reliable to use becasue when i was reading the documentation i noticed that there are alot of issues and defects to overcome and can i use it to retrieve data from mysql database.
Thank you.
I am currently evaluating it. As compared to other javascript data visualization frameworks, i think it has a lot going for it:
dynamic loading is built-in
diverse, many things to choose from.
looks really great!
framework mostly takes care of picking whatever implementation fits the current browser
service based, you don't need to download anything in advance
unified data source: just create one data table, and have multiple visalizations draw from that data.
As a disadvantage, I'd like to mention security. I mean, because it's all service based, it is not so transparent what happens when you pass data into these API calls. And as far as I know, the API is free, but not open source, so I can't really check what is going on behind the covers.
I think the Google visualization API really shines if you want to very quickly whip up a visualization gadget for use in a blog or so, and you are not interested in deploying all kinds of plugins and libraries (for eaxmple, with jQuery based frameworks, you need may need to manage multitple javascript libraries that work together to deliver the goods). If on the other hand you are creating an application that you want to sell, you might want to keep more control over what components you are using, and I would probably consider using something like Flot
But like I said, I am only evaluation atm, I am not using this in production.
Works really great for me. Can be customized fairly easily. Haven't seen any scaling issues. No data is exposed so security should not be an issue. - Arunabh Das
One point I want to add here is that, Google Visualization API cannot be downloaded, its not available for offline usage. So application which is going to use it must be always connected to internet, otherwise I think it wont be able to render charts. Due
to this limitation, this API cannot be used in some applications for which internet connection is not available.
I am currently working on a web based application that will have the Google Visualization API added to it and from the perspective of a developer the Google Visualization API is very limited in what you can do with each individual Chart and if I had a choice I would probably look at dojox charting just because of the extra flexibility that the framework gives you.
If you are doing any kind of large web application that will use charting extensively then I would not recommend the Google Visualizations API it does not have enough flexibility for a large web application.
I am using Google Visualization API and I want to stress that they still won't let you download it, which means if their servers are down, your app will be down if you depend on it. I have been using it for about 4 months, and they have crashed once me once so I'd say they pretty reliable and their documentation is really nice.

Resources