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

  • Home
  • SEARCH
  • 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 631061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:55:25+00:00 2026-05-13T19:55:25+00:00

I am trying to set a cron task to read updates for a Facebook

  • 0

I am trying to set a cron task to read updates for a Facebook application. I have prompted the user to grant Offline Access permissions and i have store the session_key in the db.

I am crearing a new Facebook object and besides api and secret key I also use the session_key (previously stored in db) and the fb uid. When i am trying to create the auth token or do a API call i get a Error 104: Incorrect signature

Any ideas, experience, hints ?

  • 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-13T19:55:25+00:00Added an answer on May 13, 2026 at 7:55 pm

    I just wrote a blog entry about my search for something similar – need to write a Python cron script. Here’s what I came up with:

    #!/usr/bin/python
    import os, sys, optparse, time, json
    import facebook
    
    ##
    
    USER_SESSION_FILE = os.path.expanduser('fb-user.session')
    APP_KEY_FILE = os.path.expanduser('fb-app.keys')
    
    ##
    
    def main():
        app_keys = open(APP_KEY_FILE).readlines()
        fb_api = facebook.Facebook(api_key=app_keys[0].strip(), secret_key=app_keys[1].strip())
        opts, args = parse_options()
        if args == ['init']:
            init(fb_api)
            return
        session = json.load(open(USER_SESSION_FILE))
        fb_api.uid = session['uid']
        fb_api.secret = session['secret']
        fb_api.session_key = session['session_key']
    
        fb_api.stream.publish(message="test from PyFacebook")
    
    
    def init(fb_api):
        fb_api.auth.createToken()
    
        sys.stdout.write('Opening web page to add application (press ENTER when done)...')
        sys.stdout.flush()
        fb_api.login()
        raw_input()
    
        sys.stdout.write('Asking for offline access now...')
        sys.stdout.flush()
        fb_api.request_extended_permission('offline_access')
        raw_input()
    
        sys.stdout.write('And, finally, asking for permission to publish')
        sys.stdout.flush()
        fb_api.request_extended_permission('publish_stream')
        raw_input()
    
        fb_api.auth.getSession()
    
        if fb_api.session_key_expires != 0:
            print """We were granted a temporary key; please wait a minute and run `%s init` again.""" % (sys.argv[0],)
        else:
            if not os.path.exists(USER_SESSION_FILE):
                # Only set restrictive permissions when creating the file
                # ourselves.
                open(USER_SESSION_FILE, 'w').close()
                os.chmod(USER_SESSION_FILE, 0600)
            json.dump({
                       'uid': fb_api.uid,
                       'secret': fb_api.secret,
                       'session_key': fb_api.session_key,
                       },
                       open(USER_SESSION_FILE, 'w'),
                       sort_keys=True,
                       indent=4)
    
    
    def parse_options():
        p = optparse.OptionParser()
        return p.parse_args()
    
    
    if __name__ == '__main__':
        sys.exit(main())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 319k
  • Answers 319k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The Analysis (v9.52) help file states that: The Connections graph… May 14, 2026 at 12:12 am
  • Editorial Team
    Editorial Team added an answer An n-gram for words is just a list of length… May 14, 2026 at 12:12 am
  • Editorial Team
    Editorial Team added an answer You aren't returning anything in your pointer variable after the… May 14, 2026 at 12:12 am

Related Questions

I have a website where I need to poll a webpage in every minute
I have written a KornShell (ksh) script that sets an array the following way:
I am trying to set a javascript date so that it can be submitted
I am trying to set a flag to show or hide a page element,
I am trying to set a ViewState-variable when a button is pressed, but it

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.