Showing latest tweet using Twitter Stream API - php

I need to show the latest tweet of a specified user using the twitter stream API. I have moderate PHP, JSON and Javascript knowledge but not enough to figure out this twitter stream API on my own. Can someone explain to me what it would look like to "connect" to this twitter stream and display the latest tweet? Does something need to be done on the actual server, or can this all be done just through some json and php code in the website template?

You don't want to use the streaming API for this.
You'd want to fetch statuses/user_timeline and parse it. You could load it and parse it entirely via JavaScript, in fact, avoiding any need to do PHP work here.

If your set on using the Streaming API for whatever reason. What you could do is use something like PHP phirehose or to make it even easier as in dead simple easy. Look into and read the information posted about the 140 DEV Server by Adam Green.
His website is here: http://140dev.com/
and you can download the PHP framework/server from here: http://140dev.com/free-twitter-api-source-code-library/twitter-database-server/download/

Related

Embed YouTube Live Streaming Automatically

How to embed an YouTube live streaming automatically in an webpage using php?
Something like querying the video at https://youtube.com/user/USERID/live when a transmission is on air?
I am the author of the OP. I wrote this PHP class, maybe it will be useful for some so I'll link here:
https://github.com/iacchus/youtube-live-embed
It allows one to query a channel and embed the Live Streaming if there is one. May take some seconds or even minutes to YouTube API response to show the live streaming after the streaming is On Air.
You can easily do it with using search->list method by setting type=video and eventType=live
Here is another PHP search code sample that will get you started.
Yes, you can do it easily by using below iframe code:
https://www.youtube.com/embed/live_stream?channel=CHANNEL_ID
You may have a look this site: streambd.co for your better understanding

Create RSS feed from webpage/ Display changes from external webpage

I am Creating a web application that will get homework from schools website.
I have been creating rss feeds for the website using dapper Creating an rss feed converting that into html and then putting that into an Iframe on my website.
I think there has to be a better way to do this.
I don't care what language this would be done in but i would prefer to do it client-side with php or javascript.
I'm intermidiete level php and not so good at java script.
If you could provide detailed explanation with some code that would be great.
also I have legal permission from my school which will be the first for this to go live to get the homework.
I'm assuming you are about create an php application to retrieve the rss from external site (which already have a specific url). Well, i think its better to build a public API first at the source app/external site, to get more multimedia support.
But if you're have no problem with parsing an xml format into html directly, then you can use cURL instead iFrame(or if you didnt have cURL installed in your php, you can modify lil bit and use my Proxy Library,a PHP class which enables you to make call to internal and external site with general HTTP request by opening a socket connection to the remote host, originally writen as Codeigniter Library.)
That way, it will be easier to presenting a html view/page rather than proccess it via iFrame.

JavaScript QR Code Reader - can it be done? Or, Remote Service?

I'm doing a bit of preliminary research on an upcoming project and I have a quick question that I figure I'll throw up here while I look elsewhere, in case anyone has any experience with this.
The question is simple: is it possible to read a QR code using JavaScript? Is there a remote service to which I can pass a bitmap object from a camera and do it that way? Are there currently any libraries that allow this?
The project is going to be deployed to various mobile devices and we'd like to try to use Appcelerator to make it work. I know Appcelerator does expose the Camera API on its host devices, but whatever we do with it has to be able to parse QR codes. Is this something that can be done?
Thanks in advance!
myk
I bet it's possible, but it would be a challenge. Someone's written an AS3 library for reading QR codes. I'd start by reading up on image manipulation in Canvas.
If you go down the remote API route, Kaywa have an API you may be able to use.
You can use the getUserMedia API to get video from the webcam and you could put it into a canvas element and use the canvas to read the pixels and decode a QR code.
I don't know of a library to decode QR codes but here is one library that can do bar codes.
There's a javascript library already, however the comments are mostly in Japanese and there's no documentation.
Because of memory limits for JavaScript on mobile devices, it's likely to take too long for practical use, if it is possible with purely JS.
I don't know exactly how the Appcelerator API works with external native libraries, but your best bet is to pass the image data to the native code (Objective-C or Java) and then use a lower-level library (like iphone-qrcode) to parse the QR code, then pass the result back to the JS execution context.
This has the added advantage of working offline, which a remote service could not do.
If you want a proof-of-concept, then here it is - a motion tracker written in pure Javascript.
However, support for it is not widespread right now. Only FF and the latest Webkit builds support it afaik.
Just noticed that you wanted this for a mobile device. Then absolutely go with a remote service. It will be really taxing even on the most high end devices assuming they even support it, which I highly doubt.

Integrate Yahoo Pipes into PHP App?

I just found this pipe.
http://pipes.yahoo.com/jonbishop/8vA1gjvl3RGqWknCBB50VA
I was just wondering if it was possible to integrate this into my web app? How would I go about doing it.
Basically, I have a form on my website - I would like this form to interact with this pipe to get the relevant data.
Could someone post a summary of what I would need to do to achieve this? I can then probably work it out from there. Using PHP.
Thanks
Quoting http://pipes.yahoo.com/pipes/docs?doc=overview
Sharing a Pipe
Once you've built a Pipe, you'll be
able save it on our server and then
call it like you would any other feed.
Pipes offers output in RSS 2.0, RSS
1.0 (RDF), JSON and Atom formats for maximum flexibility. You can also
choose to publish your Pipe and share
it with the world, allowing other
users to clone it, add their own
improvements, or use it as a
subcomponent in their own creations.
So you'd access it with any Feed Reader or XML lib you like. I am not aware of a public API for building Yahoo Pipes programmatically.

PHP / AJAX toolkit to make a "live graph" (eg for tracing stock prices)

how do i (after getting the right stock prices from a source) show it on a "live graph". i'm looking for a php/ajax toolkit that allows me to create that graph live?
is that the right thing to use or a flash based solution is better?
are there 3rdparty sites that offer to create live graphs given input data?
Highcharts is probably what you need.
I recently started a new project to simplify the construction of a graph when using php:
http://aloiroberto.wordpress.com/2010/02/04/highcharts-php-library/
Also, Google Charts or Open Flash Chart are concrete possibilities (the latter will require Flash).
you can have a look at JPGRAPH. It is a wonderful library for creating wide variety of graphs.
As far as ajax is concerned this library outputs the graph as a picture file, so you can easily send the required parameters using ajax and build the graph dynamically using ajax.
PHPlot also is a free library: http://phplot.sourceforge.net, but compared to JPGraph it's rather limited. It also delivers a picture so you could grab that via AJAX and display it.
Birdeye has some incredibly powerful graphing tools. Check out the Birdeye Explorer to get a sense of what you can do with it.

Categories