2

I am working on windows. I have built a twitter application using the twitter API which periodically checks for new tweets as well as allows users to update their status. I have written separate PHP files for reading (reader.php) and writing tweets (writer.php). The only problem is how do I periodically read the tweets. There are a few ways which I can think of -

1) Use a time-based job scheduler (like Cron) to periodically run the reader.php. How do I do this?

2) Use multithreading to run both reader and writer.php and use a timer function in reader.php

Suggestions?

4
  • Multithreading and Windows? Use something else. Why PHP? It's not the proper tool for your task IMO. Commented Apr 21, 2010 at 4:54
  • 2
    @shinkou: No, PHP is perfectly well suited to this task. The problem is that the OP is mistaken about this task requiring multi-threading. Commented Apr 21, 2010 at 4:55
  • PHP code is very easy to write and smaller as compared to Java.. Commented Apr 21, 2010 at 4:55
  • 1
    Finally, someone else who sees Java as 'bloatware'! Commented Apr 21, 2010 at 5:04

2 Answers 2

3

Since you are working within Windows, you probably won't be able to use cron very easily. You can however, use the task scheduler. See this link for step-by-step instructions.

Sign up to request clarification or add additional context in comments.

Comments

0

Another option is to use some kind of job queuing system. The Zend Server Job Queue has the ability to schedule recurring tasks. I use it on my site for an awful lot of stuff. Actually, a lot of what you are trying to do. It does periodic Twitter searches, processes relationships and such. I have a posting about how to use it at Do you queue? Introduction to the Zend Server Job Queue

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.