Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can't share the search result #5

Open
lucasduffey opened this issue Feb 27, 2018 · 3 comments
Open

You can't share the search result #5

lucasduffey opened this issue Feb 27, 2018 · 3 comments

Comments

@lucasduffey
Copy link

lucasduffey commented Feb 27, 2018

After searching for a site, the url remains http://areyoufakenews.com/, it should be something like http://areyoufakenews.com?site=evilnews.com so you can easily share the results with people

@N2ITN
Copy link
Owner

N2ITN commented Feb 27, 2018

I agree! I'm open to pull requests if anyone knows flask and wants to fix it.

@lucasduffey
Copy link
Author

relevant: https://github.com/N2ITN/newscraper/blob/be968db3246e43959c01a6e6b048d92fecaaa61e/web/app.py#L54

Not sure if it's as simple as changing to if request.method in ['POST', 'GET']:

will have to check in free time

@N2ITN
Copy link
Owner

N2ITN commented Feb 28, 2018

I don't have a chance to try it at this moment, but while we're brainstorming:
It might just be a matter of defining a new function for the main function def hello() to call using a dynamically generated app route, instead of returning the template in its own scope:

Something like:

@app.route(f"/results_{name_clean}", methods=['GET', 'POST'])
def user_results(val,pol,fact):
    return render template('index.html', value=val, pol=pol, fact=fact)

(where name_clean is the top level domain of the url with no punctuation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants