Answer the question
In order to leave comments, you need to log in
How to find a word using regular expressions?
How to use regular expressions to find the word album, and remove everything before it. and the very word. re.sub("[\bum\w+]*",''
I tried this, and in different ways, it does not work.
The link is like this.
https://vk.com/album
Answer the question
In order to leave comments, you need to log in
The pattern is - '.*album'
Learn regex - https://docs.python.org/3.5/library/re.html
"The task is to cut the link, of this form
https://m.vk.com/album-39243732_221039994 "
Try this condition:
(?<=.album-).*
It is convenient to check here https://regex101.com/
When logging in through a social network using oAuth, it (the social network) will usually give at least a user ID, but, for example, you can also request a token in the vk api, with which you can get more detailed information about the user (of course, by requesting permission access to this information). Then you just save the registration data that the user entered in your database along with the identifier from the social network, and when you enter the site, check if there is such an entry in the database.
FB: https://developers.facebook.com/docs/reference/dia...
Twitter: https://dev.twitter.com/oauth/reference/post/oauth... and https://dev.twitter .com/oauth/application-only
Google: https://developers.google.com/accounts/docs/OAuth2
Google even has an example on github for puff: https://github.com/google/google-api-php-client
https://ru.wikipedia.org/wiki/OAuth is possible, v1, but v2 is better
Quick ways:
loginza.ru
ulogin.ru
^^^
Yes, and it’s easy to integrate, but if you yourself want, then you won’t get by with two words, read the mana / api for each social network and implement
To be honest, there are plenty of guides on the Internet for each network. Only on Twitter it is perhaps difficult to find an up-to-date example, because everywhere there is info on their outdated methods.
In fact, after all the oAuth operations and getting the token, the network gives you the user_id, and then you check if it is in your table. If not, insert a line and it will be registration. If it was, then do your authorization with the found string. Everything.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question