Using an external API with pubnub DSN - javascript

I'm working on a co-project for college for my final year and am making a data visualization web app using stocks. I'm hoping to use PubNub to stream my data but have been reading through the documentation on how to hook up an external API in javascript for the data such as yahoo finance or openexchangerate.org. Maybe I'm just being clueless but I cant see it anywhere but is there anyway to do it? and if so being pointed in the right direction to an example or documentation on it would be much appreciated.

PubNub Data Feed Use Case
High level steps to implement this:
get the data from the data feed service (not PubNub) on your server. You will need to register for an account for that service (Twitter feed, stock price feed, Wikipedia changes, etc).
publish that data to channels of your choosing using PubNub.
your client apps will subscribe to those channels via a UI that you create for them.
See PubNub Realtime Data Streams Examples for more details.
Let me know where you get stuck and need more details.

Related

Using AWS SDK to help call and allow a user create a tracker API in JavaScript?

Ive been trying to create a form where users can provide a name and location then create a tracker, to be used alongside Location Services Maps. I fee like i am close but am not sure why its not working nor rendering.
A few initial thoughts based on the code snippet you shared:
I don't know enough about your use case, you wouldn't need to have more than one tracker per asset type when tracking moving objects. If that's the case for you, create trackers using AWS CLI or AWS Console.
If you'd like to create trackers using the JavaScript SDK, first, you need to authenticate your request. See Prerequisites for using Amazon Location Service and Geofencing and Tracking to get more information.
Check your input parameters (params) against the CreateTracker API requirements and make sure you're using the right parameters and passing the right values.
Check your browser's console and post the errors you're getting here to help me better understand the issue.
Note that createTracker creates a new tracker that does not have any data - this means that there is nothing to render yet. To track your assets, you'll need to send position updates to the tracker. See Start Tracking for an example.
Share a bit more about your use case, i.e., what is it you're trying to do. That'll help me better understand the problem.
UPDATE: here is what I'd do for your use case:
Create a tracker using AWS Console or AWS CLI.
Use AWS Amplify to push position updates to the tracker when building iOS or Android apps.
Use AWS IoT Core to send position updates to the tracker when building something else like a web app. See Tracking using MQTT with Amazon Location Service for an example. I'd consider AWS Amplify PubSub to send/receive messages to AWS IoT Core when building on the web.
Send metadata like the name of the food truck, food type, etc. along with position updates using PositionProperties - see Update your tracker with a device position. This would help me attach more information for data visualization or analysis purposes.
Hope this helps.

React : Get data from Google Analytics API

I'm creating an application using React and Laravel.
I integrated successfuly Google Analytics using this react-ga so when I check my Analytics dashboard the statistics of the pages of my project are there.
Now I want to display those data in my application to the users.
I've searched alot and I found that I need to use Embed API. The problem here is that it request an authentification each time a user want to access to the data. Searched some more and the solution was apparently to setup a service account as a user in Google Analytics.
Now that I have the account set, the API key generated, I don't know how to call the data from the server to my application.
There is this guide for javascript but I had a hard time implementing in React.

Dynamic Data in Shopify Blog Page

I want to write an API, i.e. hosted at www.api.mywebsite.com (not affiliated with Shopify) and then have a shopify blog post that queries that API and displays that data using javascript.
I know how to do the API potion, but can I and if so how do I do the second part where I use JS to query and display data?
Simple! Add an App Proxy to your App. With that, you setup an end point to call in your App. On the blog page you can send an Ajax GET with an ID to your App, which can then get dynamic content ready for you to use. You can either format the response as Liquid or as JSON as two examples. Send back Liquid, and Shopify renders it for you. Send back JSON and you can stamp out your data in a template.
And best of all it is a secure callback to your App that you know came from Shopify, so you have no hassles or security problems. Look in your App for Extensions, and enable Online Store, where you can tinker with the Proxy.

Azure Media Services Job status webhook notifications

I have a nodejs based application that I'm running on azure. It's basically a CRUD app for video files. I'm currently able to upload and create jobs with Azure Media Services via the REST api (https://app-name.restv2.westus2-2.media.azure.net/api/Jobs). However I am unable to get any job status or resulting metadata. Ideally I will create a thumbnail and then send the assetID back to my servers along with the sources metadata and from there I can determine which other output types I'd like to create.
I've attempted setting up an Event Subscription via a webhook endpoint in the "Events" blade of my instance of media services on the azure portal website. The way I understand it I should be getting https POST requests whenever there is a status update?
I know that I need to validate the endpoint as per the instructions here: https://learn.microsoft.com/en-us/azure/event-grid/security-authentication#validation-details
And have done so successfully.
Am I missing something? I can see and successfully log the initial validation query from Events but never get another event of any type.
Any info you can toss my way is MUCH appreciated.
If you want to use webhooks, please follow the steps in this document. The Event (Grid) notifications work only with our v3 APIs which are currently in preview. And in v3, we have not completed the work to return Job details - you would only get notified of the final state of the Job.

How to make Twitter application that shows me tweets from specific trends?

I am planning to make a web application which will just show me all the tweets for a specific trending topic. For example, if I have #WebTech #SEO #SHARE, I want to see all the tweets for this trend. Can you tell me how to get along with it? I have knowledge about programming and I would like to make it using the JavaScript APIs may be using the REST in JavaScript. Please let me know the API and the method in which I can do this. I don't want to authenticate a user. I just want to show them the trending topics. Please help.
I prefer the streaming API for stuff like this.
If your interested in the streaming API, it can be used for this but will requires quite a bit of work to really get it to be good enough for production.
However you would have to use a server side language to open the stream so it will be secure and parse the json into a database or straight json file. You could then have javascript use these as a data source.
These resources are invaluable for getting started with the streaming API.
PHP READING STREAM
http://hasin.wordpress.com/2009/06/20/collecting-data-from-streaming-api-in-twitter/
TWITTER STREAM API
https://dev.twitter.com/docs/streaming-api/methods#track

Categories

Resources