 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Abhinav Singh's Blog: Writing your first facebook chat bot in PHP using Jaxl library
by Chris Cornutt February 12, 2010 @ 09:16:04
With the announcement Facebook as made about opening up their chat service to outside connections, several developers are taking the opportunity to create their own scripts to interface with the service. One developer, Abhinav Singh has posted a tutorial about the sample application he's created to do just that.
Today facebook officially announced availability of it's chat through jabber/xmpp clients. This is a big win for XMPP, with almost 400 million new probable users adding into XMPP club. In this post, I will demonstrate how to connect to facebook chat servers using Jaxl client library in PHP. It can further be used to make custom chat bots for facebook.
He shows how to use the Jaxl library to make the connection, setting up some basic environment variables and making the connection to the server. The index.php file that comes with the library reads this config file and sends a default message to the server and returns the response.
voice your opinion now!
facebook chat connection jaxl library
DeveloperTutorials.com: Writing A Simple Twitter Client Using the PHP Zend Framework's OAuth Library
by Chris Cornutt October 22, 2009 @ 18:25:15
New on the Developer Tutorials site there's a tutorial from Padraic Brady showing how to create a simple Twitter client (to connect and send a tweet to the timeline) via an OAuth (Zend_OAuth) connection.
I finally got around to patching and finishing Zend_Oauth's Consumer implementation for the OAuth Core 1.0 Revision A specification. Once I had it finished, I used it to write a quick and simple interface to post some Tweets on Twitter while I was testing it out. [...] In this article I'll explore how to writea quick Twitter client so you can post tweets (those short messages of less than 140 characters) once authorised across the OAuth protocol.
He briefly covers what OAuth is and how its used to connect to sites in place of the more widespred method of a username/password combination. His script shows how to create the OAuth object with the right credentials and have it send a tweet as that login.
voice your opinion now!
oauth connection tutorial twitter
DeveloperTutorials.com: Port Scanning and Service Status Checking in PHP
by Chris Cornutt April 08, 2009 @ 08:49:21
On the DeveloperTutorials.com site today there's a new tutorial showing the creation of a port scanner with PHP - a tool that, given some of the familiar ports that services (like web or email servers) run on, can check to see if they're responding.
While building web applications, it's often important to keep an eye on the other services running on your server. Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.
Their example makes a socket connection to the remote port to see if there's a valid hookup. The wrap this inside a loop for ports 1 through 1000 to see what ports are open and responding on your local machine (doing this on a remote machine is just asking for trouble).
Their full example defines some of the common ports in an array and loops to check on their status. It sets out a base you can build on top of with things like their suggestions - logging scan results, repoting downtime and running a service-specific task.
voice your opinion now!
port scan fsockopen socket http ftp pop3 check connection
Lukas Smith's Blog: Persistent connections with MSSQL
by Chris Cornutt December 11, 2008 @ 12:01:26
Lukas Smith is looking for a little help on a strange problem he's seeing connecting to a SQL Server with persistent connections:
We are connecting to SQL Server via mssql_pconnect(). MaxChilds is set to 256 and we are only establishing one connection per request. So as a result I am expecting a maximum of 256 established connections. A client went into production yesterday and due to a missing index the server ended up being insanely loaded, as the queries started to block each other. The sysadmin checked the state of things via netstat and found that there were close to 500 tcp connections to the SQL Server. What gives?
He checked FreeTDS and the MaxRequestsPerChild settings to ensure that nothing there could have caused the problem, but hasn't found any hints so far. If he can't solve it right away, he also wonders if there's a way to kill idle connections if they're not used in a certain amount of time.
There's already one connect that mentions a similar issue but with Oracle connections, also on RHEL, but no definitive answers so far.
voice your opinion now!
persistent connection mssql mssqlpconnect tcp problem freetds
Evert Pot's Blog: Forking and MySQL connections
by Chris Cornutt December 03, 2008 @ 12:07:32
Evert Pot has a quick post showing how you can make your code fork MySQL connections for better performance.
For some of our long-running processes we use PHP. It makes total sense from our perspective, because we can re-use all our existing business logic from our main PHP web application. To make things more efficient, I recently started some work on using forks and have a couple of worker processes around.
His sample script makes use of the pcntl_fork and pcntl_wait functions in PHP to spawn off processes that will be closed off when no longer needed.
voice your opinion now!
fork mysql connection pcntlfork pcntlwait
Maggie Nelson's Blog: To persist or not to persist?
by Chris Cornutt August 22, 2008 @ 11:18:12
On her blog, Objectively Oriented, Maggie Nelson looks at a topic she was debating for a new application - whether or not to use persistent connections to her database.
There's a connection already waiting for you. Yay, right? Well, with MySQL, connecting is actually really really cheap, and frankly, if you are using persistent connections, you might encounter some issues with Apache going zombie on processes that use a connection, effectively taking that connection out of use. Grrr.
She did some research on the topic but found contradicting evidence for both sides. Eventually, what her choice boiled down to was this possible issue mentioned by Jay Pipes (of MySQL):
If you use Apache, Apache can zombie a PHP process and cause the mysql connection to be held until the mysql server restarts...
voice your opinion now!
persistent connection database mysql choice
Doug Brown's Blog: Zend_Cache is Saving me Money!
by Chris Cornutt July 04, 2008 @ 07:55:01
Doug Brown has posted a new entry to his blog about how the Zend_Cache component of the Zend Framework has saved him some money.
He and his site were taken offline by his own hosting company because of one little detail - the limit on usage for the shared server was 3% and his site was using 30%. Going through his logs, he found the culprit - a "too many connections" message from MySQL due to the number of requests.
I'll admit, I was in a huge hurry to get this project done, so I wasn't thinking about the long term effects. Needless to say, I wasn't caching my MySQL query results. I know, tisk tisk.
He added a new private method to his class (using Zend_Cache to store the date) and dropped the call into his controller to pulled the cached info whenever it needed it.
voice your opinion now!
zendcache zendframework hosting shared mysql connection usage cache
ThinkPHP Blog: Using LDIF to simulate LDAP transactions with PHP
by Chris Cornutt July 01, 2008 @ 08:45:18
On the ThinkPHP blog today, there's a new post from Stephanie Ehrling about simulating an LDAP connection and data request to PHP with LDIF.
An LDIF file is a simple text file that can contain those LDAP information, which can be separated into two groups. On the one hand, it can hold exported LDAP data in a text format. The other purpose of LDIF is to use it for importing data into an LDAP based system. So it can contain data to be imported or just commands that shall be processed. This is an important fact, because that opens the door to an interesting workaround.
This workaround allows you to import large amounts of data quickly and easy by dumping it into the server via a simple PHP script. The code is included in the post, but you'll need to have the binaries to get the LDIF and LDAP functionality working together.
voice your opinion now!
ldif simulate ldap connection data import binaries ldapmodify
|
Community Events
Don't see your event here? Let us know!
|