Twitter client application with twitter streaming API in PHP - php

I want to implement some of the twitter's client application's features in a web application, for example updating the timeline and searching for users etc. Now from what i found out by searching is, to do this in real time without refreshing a page or time delay, i would need to implement twitter's streaming API(user stream). I understand the twitter's REST API but unfortunately, i cant get the concept of streaming around my head. The documentation didn't help much either. For example about keeping a connection open and populate the page with real time tweets. I am planning to do this with PHP. Can anyone provide me an insight on how to go around doing it and what library to use?

Maybe you could try phirehose. Supports Streaming API and REST API as well. Check its Introduction page in the Wiki to understand how phirehose handles the Streaming API.
https://github.com/fennb/phirehose

Related

I would like to create a live video streaming site in php and WebRTC

I have reached a good stage in programming (php), but there are some things that hinder me in progress, which is that I cannot create some types of sites and use some APIs, and sites that hinder me in progress
And the first problem that hinders me is: -
I would like to create a live video streaming site and have read and found that I have to use webRTC, but I only found a two-person connection or a server used to connect to more than two people, but that is the point. I did not find a source for learning or an application example that shows me what I want, is there any application available in php and webRTC so that I can learn and please if there is an open source application and not documented, because I am not strong in the English language, I am in the stage of learning
When I understand and I can program the first obstacle, which is a live broadcast video, I will request your help again in some problems, which are sms api, visa api, paypal api and imap in php
Thank you in advance
As you may have already realised WebRTC knows how to communicate with other peers, but it doesn’t know how to discover these other peers. For discovery you can try Ably - use it as a realtime signalling platform in collaboration with WebRTC.
I'd really recommend having a look through Ably's WebRTC tutorial series. More specifically there's a tutorial focussed on video calling using WebRTC and Ably. I hope that helps, or is at least a good place to start.

Best way to build a Shopify App with OAuth

My client would like a twitter feed that just shows her most recent tweet on her Shopify site. She needs it to be more customizable than the current standard widget provided by Twitter is.
There is a Shopify app that someone built for a monthly fee that does this, but I'd like to build it on my own.
I have already built a stand-alone solution with the Twitter API and twitterOAuth PHP library. Since I can't run the PHP on Shopify, I figured I need to build an app.
Just wanted to see if I'm on the right track or if there is a better way to do this. Thanks in advance.
If you can handle Twitter oAuth, then clearly you can handle Shopify oAuth. As per what we can barely call standards, it turns out using oAuth is pretty much the same between all these services. So Shopify oAuth is going to pose no trouble for you. Hence it is relatively easy for you to create an App in PHP in the cloud, that scrapes Twitter, and provides said scraped Tweet to Shopify.

Youtube Analytics PHP cron

I want to start developing a tool that runs daily via cron for getting daily analytical data from one channel, or video, etc.. through the "Youtube Analytics API". And not what is the best way to approach it.
I have read the documentation of Google and and I have several questions:
I created the project in the console (https://code.google.com/apis/console/) but I doubt what kind of application I have to choose when I create a Client ID (Web Application, Service Account or Installed aplplication).
What PHP library use?
It's a very new API and not much information.
In the Google GData site there is a warning about that "Most newer Google APIs Google Data APIs are not Google Data APIs." and in the google-api-php-client, no examples of this API.
What is the best method for authentication in a cron?
As you can see I am very confuse, can someone help me, please?
Thank you.
1) It will be an installed application unless you will run it in a web server.
2) Use the official library, add the ytanalytics php library. Samples: https://github.com/youtube/yt-samples-php
3) You can do so by getting a refresh token from OAuth2 Playground and setting it in your youtube object.
Here it explains a little more.
And a step by step video.

Writing a PHP API and an Android app

I have a shop project written with Zend Framework 2 and now I want to write an app for this project. I'm new to this whole Android thing (I wrote a few test apps, but no big project like this). So at this moment I'm planning the "app-project" but i didn't find that much till yet.
I have to write the API in PHP and the complete Android app, so I just wanted to ask if someone can show me some good tutorials/sites etc to get more information for this (there are some big topics I'd like to know like security with the JSON communication etc).
If you're building your API in PHP assess first which framework you want to use. I've had success using Yii to build a quick REST JSON API. After getting to grips with Yii this article explains in detail the process of building a REST API: http://www.yiiframework.com/wiki/175/how-to-create-a-rest-api/
You have a few choices in terms of authentication and securing your API. Firstly make sure all data is sent over https otherwise your efforts to secure your API are wasted because anyone listening on your network can read requests/responses in plaintext. Look at using OAuth or a HMAC pattern similar to Amazon web services for authenticating requests. Here's a great article on the latter: http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/

How to be notified when there is mention and DM in twitter

I'm wondering how Boxcar works, anybody knows? I know how to do the push notification from server to iPhone, but I have no clue of how to create the server to get the #reply and dm from twitter in real time. Any suggestion on what I should look into to create the server? Should I use Twitter's streaming API or User Streams API?
Any sample code, in PHP preferably, will be great :) Thanks!
Currently the only way to get mentions and DMs in realtime for more then a single user is the Site Stream API. You can use the Phirehose library with the OAuth/userstream patch to connect. Unfortunately Site Streams is currently in closed beta and you may not be able to get access for a little while.
Otherwise you pretty much have to poll the REST API frequently to simulate realtime.

Categories