Open irfanshehzad opened 9 years ago
You will need OAuth2 access. Developer_key alone does not have enough permission to get the statistics.
To make it easier to have OAuth2 auth, you should look into refreshToken. Again, I don't have the Ruby code, but here is how to create an auth object in Java and I think you can adapt easily to your project.
new GoogleCredential.Builder()
.setJsonFactory(JSON_FACTORY)
.setTransport(HTTP_TRANSPORT)
.setClientSecrets(clientId, clientSecret)
.build()
.setRefreshToken(refreshToken)
Where is this documented?
I want to get videos view counts plus number of likes and dislikes Here is my code in ruby
opts = Trollop::options do opt :q, 'Search term', :type => String, :default => "#{search_params}" opt :maxResults, 'Max results', :type => :int, :default => 25 end
It works fine if I set opts[:part] = 'id,snippet' but getting this error "Google::APIClient::ClientError (status)" on setting opts[:part] = 'id,snippet,status,statistics'
Please help me and tell me what should I do to get number of views , likes and dislikes in search list
Thanks in Advance