Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 683589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:43:26+00:00 2026-05-14T01:43:26+00:00

I experimenting with twitter streaming API, I use Phirehose to connect to twitter and

  • 0

I experimenting with twitter streaming API,
I use Phirehose to connect to twitter and fetch the data but having problems storing it in files for further processing.
Basically what I want to do is to create a file named

date("YmdH")."."txt"  

for every hour of connection.

Here is how my code looks like right now (not handling the hourly change of files)

public function enqueueStatus($status)
$data = json_decode($status,true);
if(isset($data['text'])/*more conditions here*/) {
  $fp = fopen("/tmp/$time.txt");
  fwirte ($status,$fp);
  fclose($fp);
}

Help is as always much appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:43:26+00:00Added an answer on May 14, 2026 at 1:43 am

    You want the ‘append’ mode in fopen – this will either append to a file or create it.

    if(isset($data['text'])/*more conditions here*/) {
        $fp = fopen("/tmp/" . date("YmdH") . ".txt", "a");
        fwrite ($status,$fp);
        fclose($fp);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experimenting with the Twitter streaming api, and am trying to open a stream
I've been experimenting with the Twitter API because I want to display a few
I'm experimenting with Twitter Bootstrap 2.0 and want to use the popovers . I've
I'm experitmenting with the Twitter API (OAuth). I have a test bed that can
I am about to implement a twitter sharing functionality in my WP7 app, but
In experimenting with scriptblocks, I was attempting to use a scriptblock parameter with an
I'm experiencing some problems regarding Twitter OAuth within an android activity. I read a
After experimenting with many IMAP API's, I have decided to write my own (Most
I've been working with the twitter search api, retrieving tweets with a php script
When experimenting with Cassandra I've observed that Cassandra writes to the following files: /.../cassandra/commitlog/CommitLog-<id>.log

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.