I will try to be as specific as possible. I am trying to make a request by POST method to publish a certain link in my profile. I've used the Facebook API, but it's not what I need. I need to do this:
Image of Share a Guide
When I click click publish, I should post it to my profile, I need to do this without the Facebook API. I have noticed that clicking on the 'post' button makes a post request, but I do not know how to do it in Python.
I left in this link the buttons that are used to share.
jornadahci.com/test/test.html
I would appreciate your cooperation.
Thanks for you.
Edit: I did it with the Facebook API, it worked perfect. But now, I want to do it without the API and perform the automatic script. What causes me doubt is POST requests, if you note, when you click on 'publish' you will make about three requests. Also, I do not know if the script would need a cookie to know what account this.
Related
I'm currently working with the Spotify API. To work with it, I need to get the user to authorise and give permission for me to use their account data. After the user provides this permission, they are redirected to the Spotify homepage. In the URL of the homepage, they are taken to two query parameters including an authorisation code like so: https://open.spotify.com/?code=AQAKS1CbcTdK3...7JSQ.
How do I now get this code from the URL? I'm very new to this kind of programming so, if there is something I explained poorly, this is the link to where I got this info: https://developer.spotify.com/documentation/general/guides/authorization/code-flow/
Thanks so much to anyone who can help :)
Context: I'm trying to automatically scrape a pdf file from a website, but the file is linked to a button (pressing it starts the download). Inspecting this button with chrome developed mode informed me that the button initiates a POST request which in turn starts the file download (I assume at least). I'm trying to recreate this post request using python's requests module, but to no succes so far.
The Question: I've been googling for a couple of hours and I can't wrap my head around the header information that goes along with a POST/GET request. I can't seem to figure out why and when someone would add header information and when it is required for a successful POST request. If someone could enlighten me I'd be very grateful.
A Linkedin friend's full profile is not viewable without login to our Linkedin account. Is it possible to use cookie or any other alternative way without a browser to do that?
Any tips are welcome!
You may want to check out python-linkedin package link
LinkedIn REST API uses Oauth 2.0 protocol for authentication. In order
to use the LinkedIn API, you have an application key and application
secret. You can get more detail from here.
Thanks #Anzel, but related-profile-views API allows to read past profile view, but not trigger a new view (and therefore notify the user that I visited their profile programmatically). Unless I pop up a new window and load their profile, but then I'll need a browser to do it. Ideally I wanted to achieve it via backend, cURL and cookies, but it it's not as simple as it sounds.
I'm working on app which saves things from many cross domains via Ajax POST method to my server/app. I need to find a solution how to send a POST and verify if the user who sent it is already signed on my site and than save it to the database.
I am pretty sure that I need Chrome, Firefox extension to do it, because I need to embed my js on every page my users surf on. The thing is I don't know where to start and how should it work. I could set up proxy to make JSON POST work, but I don't know how to verify if the user is signed on my site.
Should I get cookies of my users from browser via Chrome API and sent it in the POST and authenticate the cookie/session in Django? What do you suggest?
Thank you for your help. I appreciate every hint.
When the user logons at http://yourserver.com, you can set a permanent cookie to identify him. (see SESSION_EXPIRE_AT_BROWSER_CLOSE and COOKIE_AGE variables in django)
Then, when he embeds any JS from another site from yourserver.com domain, the cookies are automatically sent for this domain, and you can check on your django side for the cookie existence and validity and give the good JS.
Because of crossdomain issues, you should better use form POST as an alternative as AJAX as it is not security restricted. You can then play with iframes and javascript to make both domains communicates.
To embed the JS in another website, you can use a browser extension, or a simple bookmarklet, which will load your code in the current page when the user clicks it from any webpage.
My 2 cents;
I've been developing a Facebook app using Google App Engine in Python and the pyfacebook bindings. For weeks everything worked fine but suddenly it stopped.
At first I thought it was a code change so I rolled back the entire dev directory to a version I knew worked, but still it failed. It's possible a change I made to the application's settings caused the issue but, if so, I can't figure out what.
I've figured out that the problem is that instead of calling the post(self) method of my Main class, Facebook is calling using a GET.
Does anyone know why Facebook would use a GET method instead of a POST? It's an IFrame app.
Thanks,
The typical flow for a user when using the application begins with the user landing at some Canvas URL, like http://apps.facebook.com/runwithfriends/. At this point, Facebook will load up it's chrome, and render a tag to your application. You'll notice there isn't a src specified. Using some JavaScript and the tag, Facebook triggers a POST request to your application. This is done for security reasons, as the sensitive user data won't be sent via the HTTP Referrer header as long it's sent as POST data.
Although I'm not completely sure this was the cause, it appears I changed from an FBML app to an IFrame app. FBML mode relies on POST calls but IFrame appears to use GET. I'm inferring this answer from what I read here as well as from the observations I'm seeing and this being the only answer that makes any sense.