How could I build an Api that returns the video in a byte array? - pytube

It seams like I can use pytube only in a console application but I wanna use it in a SPA application
How could I build an Api that returns the video in a byte array format so I can call the Api from a SPA application a download or play the video from it.
Thank you!!

Related

Connecting a Java desktop app to Firebase-analytics

I have three types of clients that work with my server at the moment: Android, Web (Angular) and а Desktop-application written in Java. There is a need to send events to Firebase-analytics from each client. I am clear on how to send events from Android and the Web - this is described in the documentation. But i can't find the way to send events from desktop-app. So, i have several questions:
Is this option possible?
Maybe the answer, is to send events to BigQuery? So, what is the difference between sending events to Firebase-analytics and BigQuery (via the REST API or using client libraries) associated with Firebase-analytics?
There are only client libraries for web and mobile apps. Desktop apps are not supported.
You could certainly have your desktop app send data to BigQuery, in order to augment existing data from Firebase that you export to it. If you do this, you will have to create your own queries to analyze the data - the Firebase console will not be able to see the data you put there directly.

Firebase: responding to http POST request

I was thinking of import my server Java code to firebase, basically replace my Dynamic web app with Jeresy and mongoDB to Firebase using hosting and functions .
I have implemented the sendWelcomeEmail and sendByeEmail with events user.created and user.deleted.
But now I want to do something more complicated.
Based on post request that comes from the mobile I want to extract the JSON data and then update the DataBase.
So I created js file with plenty of functions but now I am not sure it will actually work.
Is that the best way to implement this workflow.
The workflow goes like this.
Image is taken on the android device => extract information from image ==> upload the Json Data to the server (Firebase Hosting) => functions is been execute is response to POST request ==> extarct the data ==> save it to the Firebase Database.
Let me know if this sound ok, or I need to implent another workflow.
Thanks
Eran
The whole idea of Firebase is that your app talks directly to backend services (such as the database, or cloud storage), and you only write server-side code (with cloud functions) for functionality that Firebase doesn't provide a client-side API for.
Why don't you simply let the Android client write directly to the Firebase Database?

How Do You Call A REST API From Within Watson Conversation?

I am testing out this android chat application using Bluemix https://github.com/IBM-Bluemix/chatbot-watson-android
At some point in the conversation I will need to call a REST API/webservice to retrieve info about data that has been gathered and send it back to the user as a chat.
I don't want to do it from within the android application as the application wont work when I deploy it to another platform (e.g. slack).
Is there a way to call REST APIs from within watson?
I don't think the conversation service can do it directly, but can it link to another Bluemix service and use the result of that?
If you are already using some form of middleware this can be achieved by setting an action tag in the .JSON editor of the node that should fire the action. This then gets picked up by your middleware listener.
Alternatively try the new cloud actions feature that has just been released here https://console.bluemix.net/docs/services/conversation/dialog-actions.html#dialog-actions which is really simple and easy
I would create a server to intermediate the communication between your app (android) and the conversation service. This server could call/retrieve the required data before sending the conversation response to your app.
As you're using Bluemix, you could use Node-Red to easily do this.
Here is an example of an app that I made exactly this.
If you are starting with Watson and Bluemix, I strongly advice trying to use the Node-red starting pack. It's really easy to integrate Watson services and call REST API/web-services, even integrate with a database.
Here is a starting point to this:
https://nodered.org/docs/platforms/bluemix
Happy coding!

implement push notification in firebase with batch

I am trying to make firebase and batch work together so that I can fire push notification when something in firebase db got changed. I followed this tutorial and now i want to make them work automatically and for that i contacted with batch's and they replied me
write your own server-side code to 1. detect Firebase db changes 2. call the Batch API.
For "detect Firebase db changes" I have to create a server-side code which will track changes and call batch's api accordingly. Then follow this documentation for attaching the changed content and send it to appropriate user.
I don't know how to create the server side code. Anyone can give me a quick instructions on it or there's any tutorial related to this?
To write server-side Firebase code you can use the node.js SDK. See https://www.firebase.com/docs/web/quickstart.html (search the page for node.js).
The API is exactly the same as the regular web API except that you'll be writing it as a node.js application that can be run on the server. You can then integrate this with Batch's API.

How to work with push notification module in drupal7? and how to store device token?

I am using push notifications module. One of my friend did an app for iphone. He gave me apns-development.pem file and i stored it in my drupal/pushnotification/certificates folder. now i have to give him the url or web service so that , using the web-service he can give device_token as parameter and that devicetoken should be stored in my database for sending push message for that particular device. Pls help me
I'm the author of the Push Notifications module for Drupal. I wrote a brief tutorial about registering a device token using services here: http://www.danielhanold.com/story/drupal-7-push-notifications-how-to-register-a-device-token-using-services.

Resources