Skip to content

Instantly share code, notes, and snippets.

@riteshkawadkar
Created April 6, 2022 13:14
Show Gist options
  • Save riteshkawadkar/b6004ead76127da3fc3a03d1613d9d49 to your computer and use it in GitHub Desktop.
Save riteshkawadkar/b6004ead76127da3fc3a03d1613d9d49 to your computer and use it in GitHub Desktop.
def sample_search_projects():
# create a session
session = Session(oauth_token=oauth_token, url=url)
# query string to filter jobs
query = 'scraper scraping scrape'
search_filter = create_search_projects_filter(
sort_field= 'time_updated', # sort jobs by descending order
min_avg_price=100, # only show jobs with in price of 100 USD
project_types='fixed', # only show jobs that has fixed budget, exclude hourly projects
or_search_query= True,
)
try:
p = search_projects(
session,
query=query,
search_filter=search_filter
)
except ProjectsNotFoundException as e:
print('Error message: {}'.format(e.message))
print('Server response: {}'.format(e.error_code))
return None
else:
return p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment