News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Social Logins in PHP with HybridAuth
April 16, 2015 @ 11:54:14

The SitePoint PHP blog has posted a new tutorial showing you how to integrate the HybridAuth library into your application for easy logins via popular social sites like Facebook, Twitter or even Google+.

A trend in many of today's websites is a feature that allows users to sign in via their social network accounts. A classic example is the SitePoint community where users have the option to use their Facebook, Twitter, Google, Yahoo or GitHub account to log in without having to register an account. In this tutorial, we will be learning about HybridAuth - a PHP library that takes the pain out of building a social login feature. HybridAuth acts as an abstract API between your application and the various social APIs and identity providers.

They jump right into things, showing you how to install the library via Composer and configure it to work with a simple Slim-based application. They set up providers for Facebook, Twitter and Google+ and show how to call the "authenticate" method to make the connection. He then starts on the sample application, creating a login page and a database table for user tracking. The process continues showing how to connect the user from the social site to your setup and retrieve their profile information. All the code you'll need is here, including the Slim structure, the database connection setup and the needed templates. You can also find the finished product in this GitHub repository.

0 comments voice your opinion now!
social login tutorial hybridauth facebook twitter googleplus socialnetwork

Link: http://www.sitepoint.com/social-logins-php-hybridauth/

NetTuts.com:
Building With the Twitter API Repeating Tweets From a Group
January 19, 2015 @ 11:18:45

NetTuts.com has continued their series about constructing a Twitter application as a Yii framework-based application. In this latest tutorial they expand on the previous post's "tweet storm" functionality and instead posts random updates based on pre-defined content. If you need to catch up, you can find the other parts of the series here.

The nature of the Twitter stream makes repetition useful, within reason; overdoing it is spammy and annoying.[...] This automates the task of repeating and creating variation over time to increase the likelihood that your Twitter followers will engage with your content. Keep in mind that the Twitter API has limits on repetitive content. You'll be more successful if you offer a wide variety of variations and run the service on an account that you also use manually to share other content.

They start with a short list of features the application needs to support including the main goal of posting the randomized, recurring tweets. They start by creating the Group model and table to allow for the grouping of tweets. Then they use Yii's scaffolding to create a form for creating new groups. Next up is the controller code to handle the group submission and an update to link a tweet to a group. Finally they include the code to push the tweets out to Twitter and mark the tweets as sent. The post ends with an example of a timeline with the resulting posts.

0 comments voice your opinion now!
tutorial series twitter api repeat tweets group random

Link: http://code.tutsplus.com/tutorials/building-with-the-twitter-api-repeating-tweets-from-a-group--cms-22490

NetTuts.com:
Building With the Twitter API Tweet Storms
January 07, 2015 @ 12:49:22

NetTuts.com has posted the second part of their series about creating a Twitter client on top of the Yii framework. In this new tutorial they focus on "tweet storms", the use of a series of tweets to share a thought rather than just cramming it into one.

In April, investor and Netscape founder Marc Andreessen began expanding on the natural 140 character limits of Twitter by publishing his thoughts in sequences of tweets, which some have dubbed tweet storms. [...] A few services arose to make it easier for mere mortals like ourselves to publish tweet storms but they seemed a bit unreliable and inconsistent. I decided to build the feature myself and I think there's value in doing this with your own app.

He outlines the features that the "tweet storm" feature needs to support and the database models/migrations that you'll need to store the related data. He uses Yii's generators to create the needed skeleton classes for the models and controllers. He moves on to the code needed to handle the group tweets management and to compose the tweets that will make up the "storm". Finally, he includes the code you'll need to create the publishing feature, pushing it into both the models/database and out to the Twitter API. You can then use the "OEmbed" information provided by Twitter to view the series of tweets via another simple page (code included here too).

0 comments voice your opinion now!
tutorial twitter storm multiple tweet yii framework series part2

Link: http://code.tutsplus.com/tutorials/building-with-the-twitter-api-tweet-storms--cms-22459

NetTuts.com:
Building With the Twitter API Using Real-Time Streams
November 18, 2014 @ 11:28:14

NetTuts.com finishes off their series covering how to connect your application to Twitter and pull data. In this latest tutorial they show the use of the real-time streams Twitter offers to those needing the most up-to-date and immediate access to tweets via a command-line tool. This tutorial makes use of the Yii PHP framework for it's execution.

While the Twitter REST API is suitable for many applications, if you want immediate updates and access to a broader array of notifications, the Twitter Streaming API is essential. For example, only the streaming API will tell you when another user favorites one of your tweets. Using the Streaming API requires a persistent, keep-alive connection between your web server and Twitter. This type of implementation may be unfamiliar to many PHP developers. As soon as tweets come in, Twitter notifies your server in real time, allowing you to store them into your database without the delay of polling the REST API. Use of the Streaming API is also not subject to Twitter's API rate limits.

They start with a brief description of the Streams functionality and provide a graphic showing the overview of the data flow when you put them to use. They make use of the phirehose library to make the connection (making it almost a two-step method: connect & consume). They walk you through the creation of a Yii command to create the command and set it up for execution. They show you how to integrate it into a larger Yii application, create a migration to store the data and execute the resulting code as a long running command.

0 comments voice your opinion now!
realtime streams twitter tutorial series phirehose connect consume

Link: http://code.tutsplus.com/tutorials/building-with-the-twitter-api-using-real-time-streams--cms-22194

NetTuts.com:
Design Patterns The Adapter Pattern
November 03, 2014 @ 11:54:20

In the latest post in their series looking at common programming design patterns, NetTuts.com talks about the Adapter pattern. This pattern makes it easier to swap out different connection types via an abstracted interface.

In this article, we will continue our discussion on design patterns by taking a look at the adapter design pattern. This particular pattern can be used when your code is dependent on some external API, or any other class that is prone to change frequently. This pattern falls under the category of "structural patterns" because it teaches us how our code and our classes should be structured in order to manage and/or extend them easily.

He starts off with the problem he's aiming to solve: a change in a "Twitter" class from one method name to another. An "adapter" lets an existing class be used from another interface, requiring no to minimal changes to the original class. He refactors the example to use an example of an adapter, creating a class that defines an object that passes in the original "Twitter" class instance and wraps the "send" call in its own method. With this in place, he also shows how to create a brand new adapter for Facebook, mimicking the "send" method, just with different functionality.

0 comments voice your opinion now!
designpattern adapter pattern socialnetwork twitter facebook wrapper tutorial

Link: http://code.tutsplus.com/tutorials/design-patterns-the-adapter-pattern--cms-22262

Cal Evans:
What Developers Want Recruiters to Know
October 15, 2014 @ 11:56:25

Cal Evans asked a question on Twitter the other day of his followers for advice, from developers, to share with recruiters and how they can do their job better when it comes to recruiting talent.

I post this not to belittle or ridicule recruiters. I think that good recruiters are a valuable part of the tech ecosystem. I post this to hopefully help more recruiter become good recruiters.

He's listed all of the responses he's gotten in the post (via Storify) as individual tweets. There's a few recurring themes happening and lots of good advice including:

  • "treat developers as human beings"
  • "We're smart people, we can see an email isn't personal. Treat us like the individuals we are."
  • "Read the profile before sending out CV, I am not a Ruby developer."
  • "Googlebing someone before emailing them. Know who they are."
  • "don't try to sound like you know what you're talking about if you don't. You just lose respect."
  • "build a relationship with me, not a one night stand"
  • " Have the decency to at least get back to devs if the end client hasn't chosen them"

If you are or know of a recruiter, please share this post with them. The unfortunate fact is that there's a lot of recruiters out there that don't realize that this is how to talk to developers (and sadly, some don't event care).

0 comments voice your opinion now!
recruiter developer advice twitter feedback opinion

Link: http://blog.calevans.com/2014/10/14/what-developers-want-recruiters-to-know/

Sameer Borate:
Sentiment Analysis of Twitter feeds
September 30, 2014 @ 10:07:35

Sameer Borate continues on his theme of Twitter-related development (part one is here) with his latest post showing how to do sentiment analysis of Twitter feeds. His "sentiment analysis" analyzes a string to determine if it's generally negative or positive based on the AFINN word dataset.

In the last post we looked into accessing Twitter API v1.1 from PHP. In this post we will see how we can add sentiment analysis for the tweets. Generally speaking, sentiment analysis aims to determine the attitude of a writer with respect to some topic. A basic task in sentiment analysis is classifying the polarity of a given text, whether the expressed opinion in a sentence is positive, negative, or neutral. In this post we will use a simple sentiment analysis library to analyze the sentiment of tweets.

His example uses the viracore/caroline library to do the actual analysis. He shows how to install it via Composer and how to make a sample checker, returning the score and the comparative ranking. With that working, he shows how to integrate it into the Twitter connection originally created in the first post, extracting tweets from his own timeline and returning their scores.

0 comments voice your opinion now!
tutorial twitter sentiment positive negative afinn api oauth

Link: http://www.codediesel.com/social/sentiment-analysis-of-twitter-feeds/

Sameer Borate:
Creating Twitter Apps in PHP
September 29, 2014 @ 09:28:42

Sameer Borate has a post today showing how you can create a simple Twitter application in PHP making use of their REST API and the twitter-api-php library.

In this post we will look into accessing Twitter REST API in PHP. This can be useful if you need to post Tweets from your PHP application or anaylze, search Tweets. In the following examples we will use the twitter-api-php PHP wrapper for Twitter v1.1 API. Although there are a few wrappers around, this one I like for its simplicity.

He helps you get the library installed (via Composer) and create an application on the Twitter side at apps.twitter.com. Sample code is included showing how to connect to the API with your credentials, including handling the OAuth authorization piece. From there he shows two examples of action to make on the API: posting a new tweet and searching for new tweets based on a query string.

0 comments voice your opinion now!
twitter application tutorial introduction library oauth search post tweet

Link: http://www.codediesel.com/social/creating-twitter-apps-in-php/

SitePoint PHP Blog:
Using Guzzle with Twitter via Oauth
July 31, 2014 @ 10:54:01

Continuing on with his series about using the Guzzle PHP HTTP library, Miguel Ibarra Romero is back with this new post showing how to connect your PHP application, via Guzzle, to the Twitter OAuth protected service.

In a previous article, we found out about Guzzle and how it can aid us in the task of establishing communication with third party APIs over HTTP. We used it to get the output of a random number generator and for basic interaction with Github's API. [...] While interacting with Github's API we discovered that it supports basic authentication (sending plain username/password). But what if the API we want to use just offers OAUTH authentication?

He shows how to use Guzzle's own OAuth subscriber to make a basic connection to the API. He walks you through the installation of the subscriber (via Composer) and an example of its use. He explains each part of the code, giving a little background on where it fits into the OAuth request and where to put your API secret and key to make the connection work. Finally, he includes the code to handle the callback once the OAuth request is successful, grabbing the token data and adding it to the user session.

0 comments voice your opinion now!
oauth twitter guzzle http library tutorial

Link: http://www.sitepoint.com/using-guzzle-twitter-via-oauth/

SitePoint PHP Blog:
Social Network Authentication Twitter and Facebook
July 21, 2014 @ 11:32:12

The SitePoint PHP blog continues their series of tutorials showing how to authentication your users against various social networks. In the previous post they covered connecting to Google+ and in this latest post they move on to two other popular social networks: Facebook and Twitter.

In the previous parts of this series, we created our initial interfaces, set up our Google+ login functionality and talked about how we can merge our accounts together. In this article, we will integrate Twitter and Facebook within our application. You will see a lot of similarities with the Google+ article, so if you could follow that one easily, you won't have much trouble with this one. If you haven't read that article yet, I suggest you read it first before continuing this article.

He starts off with the Twitter authentication, creating a new "SocialLogin" object type for it and defining the three required properties it needs to connect. Code is included to make the OAuth connection, pass along the callback URL and forward on the user to the Twitter site for approval. Code is also included to store the data about the Twitter user in your application. Next up is Facebook. The connection is very similar to the others with only a slight difference in the data that's required. You can find the full code for the tutorial so far in this Github repository.

0 comments voice your opinion now!
social network authentication tutorial series twitter facebook

Link: http://www.sitepoint.com/social-network-authentication-twitter-facebook/


Community Events

Don't see your event here?
Let us know!


performance podcast community framework symfony2 install library language api interview application example opinion configure conference php7 introduction series laravel release

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework