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 8491139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:19:41+00:00 2026-06-10T22:19:41+00:00

I am creating this cron job to get twitter feeds and store it in

  • 0

I am creating this cron job to get twitter feeds and store it in datastore. I tried everything, but my cronjob is not working. I read following articles/tutorials and some stackoverflow questions, but I can’t solve this out.

https://developers.google.com/appengine/docs/python/config/cron

http://cloudartisan.com/posts/2010-06-02-scheduled-tasks-with-google-app-engine-python/

Here is my code

This is cron.ymal

cron:
- description : capture twitter feed 
  url : /twittertask
  schedule: every 1 minutes
  target: version-2

This is the class I need to do the job.

import webapp2
from google.appengine.ext import db

class Twitt(db.Model):
    created_at = db.IntegerProperty(required = True)
    id = db.StringProperty(required = True)
    text = db.StringProperty(required = True)

class TwitterTask(webapp2.RequestHandler):

    def get(self):
        url = "https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=BeijingAir&count=10"

        json_string = urllib2.urlopen(url).read()

        data = json.loads(json_string)

        for item in data:
            created_at_item = item['created_at']
            text_item = item['text']
            id_item = item['id']

            e = Twitt(id = created_at_item, text = text_item, id = id_item)
            e.put()

        self.response.out.write('Hello prueba!')

This is app.ymal

application: cronjob
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: index.app

- url: /twittertask
  script: twittertask.app

This is index.py

import webapp2

class MainPage(webapp2.RequestHandler):
  def get(self):
      self.response.headers['Content-Type'] = 'text/plain'
      self.response.write('Hello, Check Admin')

app = webapp2.WSGIApplication([('/', MainPage)],
                              debug=True)

def main():

    run_wsgi_app(application)

if __name__ == "__main__":
    main()

Well, I can’t find where is the error. I tested on my dev server. I didn’t upload it to google app engine.

  • 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-06-10T22:19:43+00:00Added an answer on June 10, 2026 at 10:19 pm

    Cron does not work on the local dev sever. Upload it to the cloud and it’ll work.

    Visit your appserver locally:

    http://127.0.0.1:8080/_ah/admin
    

    and click on “Cron jobs”.

    http://127.0.0.1:8080/_ah/admin/cron
    

    And it will say “In production, this would run at these times:”

    your schedule here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m creating cron job that takes backup of my entire DB. For that
I am creating a cron job in which I copy files from one directroy
I have a php script and using Cpanel interface Im creating a cron job
When creating a cron job through the Rufus Scheduler, is there some way within
I've got a cron job parsing a few XML feeds every ten minutes and
I've come across a checklist for creating a new PHP cron at my job
So i have been creating this framework thing that basically puts together source code
I am creating this link tag: <link rel=canonical href=<%= request.url %> /> The problem
I had a huge file for creating this GUI and I have shortened it
Seems I've outdone myself. All the while I was creating this pretty little 'latest

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.