Using Wordpress and Python I am trying to develop a post recommendation system that looks at following information:
Additional user profile data that includes job type, interests, age and gender
Previously read posts by the user Posts that have high view count by other similar users
Posts that have high rating by other users with similar interests
And using algorithms in Python matches that data and recommends other posts that would be of interest to that specific user.
Is this possible? How can I get Python to 'talk' to Wordpress via PHP?
Any advice would be most appreciated - there seems to be no-one on google who is looking to build a wordpress post recommendation system.
You can use WordPress Rest API to implement this connection between python and PHP. developer.wordpress.org docs can help you using the word press rest api to commiunicate with the core.
Wordpress Rest API Docs
Related
I have never used an API before, but I am trying to learn how to use Scopus for a project I'm doing with a few colleagues. I have gotten about this far:
response = requests.get("https://api.elsevier.com/content/search/scopus/",
headers={'Accept':'application/json',
'X-ELS-APIKey': '[My_API_Key]'})
I keep getting a 400 error in response to this, even though my API Key is valid, and I've entered it correctly. I'm guessing I'm getting the error because the query is too large since I am just searching Scopus instead of looking for any specific author ID or ISSN.
I want to run queries to get all of the author data for a handful of specific ISSNs. As someone who is very uncomfortable using Python (I'm a web developer, not a Python programmer) and also someone who has never used an API themselves, I have no idea how to proceed from here. I've read the guides provided by Elsevier, but as I don't understand this stuff, I haven't found them helpful at all. I've also watched and read some tutorials about APIs, but none of them have helped me figure out how to make an actual specific request.
If any of you have used Scopus before, can you please tell me how to make a request based on the parameters I need? Am I supposed to put the ISSN at the end of the URL? If so, how should I format it, and how do I specify what other data I want for that specific ISSN?
I apologize for the lack of specificity in this particular question, I am just completely lost here. I am currently using Jupyter notebooks to write and run my code.
As other responders have said you are on the right track, however, your query is essentially blank, in that you are not actually asking the API for anything.
This request
"https://api.elsevier.com/content/serial/title/issn/[ISSN]?apiKey=[My_API_Key]"
will bring back general metadata about an ISSN, but to go deep with author and institution metadata, you should start with a Scopus Search API query:
"https://api.elsevier.com/content/search/scopus?query=issn([ISSN])?apiKey=[My_API_Key]"
The API Docs page, located here:
"https://dev.elsevier.com/api_docs.html"
Has more tech details about the APIs
I want to get data from my facebook page posts such as likers names, number of likes, number of comments and global info about my account like the list of users liking my page, ...
I am a bit lost with the Facebook-Graph-API website because there are a lot of packages like Business SDK, Marketing API SDK, Pages API, ...
If someone has an idea of which API it would be very helpful !
Additional question : is it possible to use the facebook graph API with python ?
Thanks
Current Facebook Graph API does not allow you to access personal information about users so you won't be able to get the names of people liking your page or your posts.
I'm new to Python and am very confused on how to begin this assignment:
Write Python code to connect to Twitter search API at:
https://api.twitter.com/1.1/search/tweets.json
with at least the following parameters:
q for a search topic of your interest;
count to 100 for 100 records
to retrieve twitter data and assign the data to a variable.
I already created the app to access Twitter's API. Thanks.
I had this same issue. According to Twitter, you must register an account to even use basic search features of public tweets and there is no way around it. I followed the guide for the complete setup here and can confirm it works
Edit: the article is for php, but changing it to python shouldn’t be very difficult. It has all the methods outlined in the article
Just as a hint, you might want to use tweepy for this. They have very good documentation and its much easier than trying to reinvent the wheel.
I've searched on google and have taken a look at the facebook site for the apis, but facebook does not have an official SDK for python. I looked at the third party api for python listed on their site that could be used to communicate with facebook. After having visited their official site and github repository there is a small readme file that shows basic usage, it seems to assume that you are already connected to facebook, and the example at the end of that page shows a cookie example.
The short examples seem easy enough but there is no explaination of anything and i dont find any more documentation about anything else.. there does not seem to be any information about all available methods you can use with the api..where do the people who are using this api get the documentation to find the methods available so they are able to do work with this ?
Since i guess people are pretty tired of signing up for yet another service i would like to offer to sign in with their facebook and twitter accounts (although thats a no no for the ad people who would like to have access to the user profile in order to have targeted words/links that generate revenue). Im using django and have taken a look at the django-facebook api as well but the documentation seems to just point to the github repository which doesnt have any documenation, almost just like the other api pointed out above. Basically i dont find any documenation about how to use the apis except from the small examples.
And like always, i appericiate your time answering this, always nice to add an explaination to any code so the answer is a little more usefull, thanks.
My info might be a little bit out of date as I was working at a startup implementing a Python backend on Google AppEngine that interfaced with Facebook, used FQL, AppEngine datastore etc, about a year and half ago.
There are several third party APIs you can use, for instance, https://github.com/jgorset/facepy or https://github.com/pythonforfacebook/facebook-sdk. The reason there is no 'documentation' on the github site is because it implements access to the API that IS documented on Facebook's developer pages https://developers.facebook.com/docs/graph-api/.
But that is in a perfect world. My experience with the Facebook APIs is that they don't always do what is said on the dev pages. You don't get consistent return data, FB Realtime API not/inconsistently notifying for certain connections (music, movies, books, tv). Unfortunately, I think they have many non-documented APIs that are only available to the big app players.
Where I got my real world working info and learned how to access Facebook using Python was right here on stack overflow.
I'm looking for an example of creating encrypted forms for paypal from appEngine running python. I've seen a lot of things that are in the neighborhood, but not the right address:
Here's the general info over on PayPal's site for generating the encrypted form. Basically the form data is encrypted and sent over to paypal so that it can't be tampered with.
This great article talks about doing this very thing in django. The trouble is that is relies on M2Crypto and that doesn't run on AppEngine.
There's a library that is based on the previous article but supposed to be hacked to run on app engine. When you poke around class PayPalEncryptedPaymentsForm they are using M2Crypto.
This lead me to try to verify that you can't use M2Crypto on AppEngine.
Turns out during this search I found this article about using PyCrypto instead of M2Crypto. There's a bunch of caveats in the article that aren't in my areas of expertise. I'm hoping that someone out there has made a run at using PyCrypto for PayPal's Encrypted Website Payments and can shed some light with an example.
Thanks.
I can't help with GAE crypto but maybe a different solution could help: Why don't you use express checkout API to negotiate a server2server token used to redirect user on to the PayPal payment process?