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

Nikola Posa:
Community-driven PHP 8 Wish List
Sep 24, 2018 @ 14:08:01

Nikola Posa has a new post to his site sharing what he calls a "community-driven PHP 8 wishlist" as gathered from replies to a tweet he posted back in July 2018.

It's been over two months since I started a research on Twitter about the things that developers would like to be added or improved in the next major PHP release. [...] It had a surprisingly long reach, inspiring developers, prominent experts, community representatives to express their opinion through more than a hundred responses.

It would be a waste to leave such a valuable data in the form of a raw and fuzzy Twitter thread, so I finally found some time to turn it into something more useful.

In the post he shares the results in a spreadsheet, with the top three being: arrow functions, multi-threading and method overloading. Other interesting features also made an appearance pretty high on the list including boot-time preloading, scalar objects, native async and built-in request/response objects. Check out the post for the complete list and how it was processed into its final form.

tagged: community wishlist php8 spreadsheet results tweet

Link: https://blog.nikolaposa.in.rs/2018/09/23/community-driven-php8-wish-list/

Scotch.io:
How To Process Tweets in Real-Time with Laravel
Apr 29, 2016 @ 14:10:16

The Scotch.io site has a tutorial posted showing you how to combine Laravel and the Twitter Streaming API to process tweets in real time inside your application.

This tutorial will show how to use the Twitter Streaming APIs to process tweets in real-time from a Laravel application. There are a variety of use cases for this: perhaps you want to auto-respond to mentions of your company, run a contest via Twitter, or create support tickets when users complain about your product. For this tutorial, we'll build a "featured tweets" widget to display approved tweets on our app's home page.

He starts with an overview of the tools and terms you'll need to know about for the tutorial and a few notes of things to watch out for. He then describes the overall structure of the application (an app just to show the tweets) and links to a repository for the impatient. He then breaks up the rest of the tutorial into several steps:

  • Creating a new Laravel application and installing the Phirehose library
  • Building a "process tweet" job and matching TwitterStream class to use Phirehose and dispatch the job
  • Make the artisan command to connect to the API and the application you created
  • Configure your queue driver and run the processing command
  • Set up a "Tweet" model to connect the application and database table

He finishes the post showing how to make the ProcessTweet Job useful, set up some basic authentication and pass the currently processed tweets into the default "Welcome" view.

tagged: realtime tweet twitter process stream api laravel job queue tutorial

Link: https://scotch.io/tutorials/how-to-process-tweets-in-real-time-with-laravel#step-11-make-the-processtweet-job-useful

Cal Evans:
7 Days of PHP 7 – The Complete Collection
Nov 12, 2015 @ 18:35:47

With the upcoming release of the first stable version of PHP 7 Cal Evans has been posting a "7 Days of PHP 7" series, linking to information about the upcoming release, presentations, podcasts and more about this upcoming version. In this post to his site he gathers them all into one place with links to everything for easier consumption.

PHP 7 was originally supposed to be released today, November 12th, 2015. The Core developers weren’t comfortable releasing it just yet so they pushed the date back to November 26th, 2015. That’s fine, we all appreciate their diligence.

Still, I had already started my “7 Days of PHP 7” countdown when they made the announcement. Because the actual release date isn’t important to spreading the word about PHP 7, I decided to continue on with the countdown.

In his tweets he links to things like the PHP 7 migration manual, an article about PHP 7 performance and video tutorials on getting up and running with PHP 7. Check out the full post for more information on these and other useful PHP 7-related resources.

tagged: php7 7days tweet resource article tutorial language version release

Link: http://blog.calevans.com/2015/11/12/7-days-of-php-7-the-complete-collection/

NetTuts.com:
Building With the Twitter API: Tweet Storms
Jan 07, 2015 @ 18: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).

tagged: tutorial twitter storm multiple tweet yii framework series part2

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

Sameer Borate:
Creating Twitter Apps in PHP
Sep 29, 2014 @ 14: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.

tagged: twitter application tutorial introduction library oauth search post tweet

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

Gareth Heyes:
Tweetable PHP-Non Alpha
Dec 13, 2012 @ 15:40:25

Gareth Heyes has a new post that shares some of his efforts to write "non-alpha PHP", using characters other than the alpha-numeric ones to write executable PHP scripts. In his case, this involves a lot of pluses, underscores and square brackets.

I started to try and break the 10 charset limit of PHP non-alpha after @InsertScript showed me that PHP Dev supports [] syntax for arrays. I wondered if it would be possible to break the limit within production PHP. At first I thought you could but then after some testing I found that there was no way to concat without “.” and no way to call a string as a function without $ and =. However since I got into PHP Non-alpha again I thought why not try and improve it and make the code tweetable.

He works through the whole process of his discovery - starting with the creation of a non-alpha version of "0" (zero), moving into letter creation and finally all the way up to a full word..."assert". The result is tweetable code that echoes that string and contains more symbols than letters. If you're interested in more of this non-alpha kind of coding, check out some of the other posts on his blog.

tagged: nonalpha code tweet plus underscore squarebracket

Link:

Emanuele Minotto:
PHP in a Tweet
Sep 14, 2012 @ 15:19:09

Emanuele Minotto has a recent post with a set of "PHP in a tweet" posts that do all sorts of things.

Yesterday an ex colleague tweeted something that captured my attention, so I started thinking to a Twitter-powered code golfing competition. Looking for other examples.

Tweets included in the list are snippets like:

  • A dependency injection container
  • A super simple web framework
  • A microframework
  • Bypassing array_intersect

There's some game rules included in the post so you can contribute your own to the the comments. Several have already been added including a base64 encoding variant and getting the extension of a file.

tagged: tweet size code twitter framework dic

Link:

Community News:
Win a phpDay/jsDay 2012 Ticket
Mar 29, 2012 @ 15:20:38

The jsDay/phpDay organizers have announced a contest to win a free ticket to this year's event(s), one for each conference:

GrUSP is organising a tweet contest and its prizes will be two tickets, one for each conference. The contest will start today (March 29th) at 1pm CEST and will end April 1st at 7pm CEST.

Anyone can enter - all you have to do is tweet a post with a few things: the "#grsup" hashtag, a mention of the twitter accounts for the events, a link to the conference site and something about the event. Be sure and get those tweets posted before April 1st a 9am CEST - they'll pick the winners soon after! (Oh and multiple entries are accepted so the more you tweet, the better your chances!)

tagged: jsday12 phpday12 ticket contest win tweet twitter

Link:

PHPMaster.com:
Understanding OAuth - Tweeting from Scratch, Part 2
Oct 25, 2011 @ 15:09:48

On PHPMaster.com today they're posted the second part of their OAuth series showing you how to use the authentication mechanism to connect to Twitter's API. (Part one is here.

Welcome back to Understanding OAuth – Tweeting from Scratch. This is Part 2 of the two-part series and picks up right where we left off in Part 1 with your returned Access Credentials. Since obtaining the credentials is the grueling part of the process, there’s not much more left to do except posting a tweet on the user’s behalf. Hopefully you’ll find the final steps to be a lot easier to follow and more fun to implement.

They show you how to store the credentials from Part 1 into your session for safe keeping and include a simple form you will use to send a tweet to Twitter. They choose to manually build the HTTP POST request, including the credential headers along with the payload (oauth_consumer_key, oauth_signature, oauth_token, etc).

tagged: oauth tutorial tweet series connection authentication api

Link:

Phil Sturgeon's Blog:
Twiny-Framework: the framework small enough to tweet
Dec 18, 2009 @ 15:28:18

Inspired by Twitto, Phil Sturgeon has create his own tweetable framework to try to "one-up" Fabien Potencier's version.

This idea was not my own, but was inspired by Twitto. During some extreme boredom at work I decided to "one-up" this teeny-tiny framework and improve on it. My framework does this by allowing you to run Controller files and methods in a similar way to CodeIgniter, while Twitto only has the ability to run functions from a single file.

He includes both the code for the "framework" and an example of how to create a simple controller class to work with it. He also shows how you can get a bit more MVC with it by adding in a view layer.

tagged: twiny framework tweet mvc

Link:


Trending Topics: