Skip to content

Instantly share code, notes, and snippets.

@TrafeX
Created January 10, 2017 14:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TrafeX/f225557cef09dea84547c9c5b6715e55 to your computer and use it in GitHub Desktop.
Save TrafeX/f225557cef09dea84547c9c5b6715e55 to your computer and use it in GitHub Desktop.
WordPress Lambda Cronjob
import urllib2
def lambda_handler(event, context):
req = urllib2.Request('https://www.thewebsite.nl/wp/wp-cron.php?doing_wp_cron', headers={'User-Agent' : "AWS Lambda Cron"})
con = urllib2.urlopen(req)
print con.read()
@eddideku
Copy link

eddideku commented Oct 2, 2019

[ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'lambda_function': invalid syntax (lambda_function.py, line 6)
Traceback (most recent call last):
File "/var/task/lambda_function.py" Line 6
print con.read()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment