Plots2: PLANNING ISSUE : Reply via Twitter .

Created on 28 Apr 2018  ·  72Comments  ·  Source: publiclab/plots2

Please describe the problem (or idea)

This is a planning issue for reply by twitter : feature .

Let's first discuss the best approach and then we shall break this into smaller independent issues .

More Details 🔜 !

=> Email Integration #2672 (@namangupta01 )

feature in progress more-detail-please planning summer-of-code

Most helpful comment

As the @jywarren we should merge the OA system with it?

All 72 comments

Cool! Link to Naman's new issue too!

On Sat, Apr 28, 2018, 3:25 AM Sagarpreet Chadha notifications@github.com
wrote:

Please describe the problem (or idea)

This is a planning issue for reply by twitter : feature .

Let's first discuss the best approach and then we shall break this into
smaller independent issues .

More Details 🔜 !


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671, or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ6EpFnMq_H5zR8vLtf7kXWZJbELxks5ttBlcgaJpZM4TrSYe
.

@namangupta01 , @jywarren ...lets start the discussion on this ? When are you both free ?

Yeah!
On Jun 14, 2018 12:55, "Sagarpreet Chadha" notifications@github.com wrote:

@namangupta01 https://github.com/namangupta01 , @jywarren
https://github.com/jywarren ...lets start the discussion on this ? When
are you both free ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-397198245,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATwCYebYN7qM2c0Emtdw2jhwYIILp5r1ks5t8g_fgaJpZM4TrSYe
.

I have some implementation in my mind...will post in a while.

Joe (who just started work with the Public Lab staff) had a really good
question -- would this be a channel for spam posting? Do we have to worry
about Twitter bots spamming, or maybe think about a moderation strategy?

What are ways we could watch out for this? Open brainstorm!

Like, maybe response tweets have to be "liked" by... someone?

On Thu, Jun 14, 2018 at 4:47 AM Naman Gupta notifications@github.com
wrote:

I have some implementation in my mind...will post in a while.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-397237305,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ_g3eeUD8-7bvLjXmQLYIz0LYM1qks5t8jEFgaJpZM4TrSYe
.

Spamming is the major issue. I was reading documentation from past few days. I was also wondering if we implement as you said "response tweets have to be liked" i found a major issue.
The issue is that whenever a user retweets on tweet (which is a node) we can know about the retweet through apis but when the retweet is liked we can't know about it. The only way to know about it is to search for every retweet status after certain interval of time which is very bad because lets suppose we have 10k retweets then we have to search for 10k retweets status for being liked in certain interval of time. And also this 10k figure will continue to rise over time.

And also one main point which could leads to no spamming is that we can only add the tweets of those users whose twitter handle is associated to any publiclab account just like we were doing in reply-by-email where email of email sender is first checked for associativity with the publiclab account.
This could leads to no spamming.

@namangupta01 ...great points !

  • Spamming is the issue here , i guess the only moderation technique i can also think of is that a moderator has to approve the comment on a tweet by liking it (Similar to how things work in publiclab.org ) .
    => moderator can be people with PublicLab's twitter account OR a PL community person who has liked from his own account .

  • I guess the point is to bring a member who is new to the community , so bringing comments of only existing people will solve half the problem .

What do you think ?

Great thinking! But the only point i am concern with is that we have to check explicitly for the tweet's being liked in every request for all the tweets on the publiclab tweets which can become very large request as the tweets increases.

And most of the time we will be making request for the tweets for nothing...that was my concern. What do you think?

However moderation technique on the publiclab website interface would work great.
Like approving comments ?

@jywarren As email feature is almost complete we could discuss over it?

I'll look to block out some time on this in a day or two... thank you!
Trying to get all the big features fully up and running before moving on.
Thanks!

On Mon, Jun 25, 2018 at 7:18 PM Naman Gupta notifications@github.com
wrote:

@jywarren https://github.com/jywarren As email feature is almost
complete we could discuss over it?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-400125415,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ-UOBtZ0G4haKmQRlSr0WJJ3Q30pks5uAW-ugaJpZM4TrSYe
.

@jywarren Can we put node_id in tweets? So that it can be easily identified?

@jywarren Is it possible to put node_id in tweets?

I think so, yes! But we turned off the autotweeting for a bit. Could we
recognize links like publiclab.org/n/____ via Twitter API?

On Sun, Jul 15, 2018, 9:26 AM Naman Gupta notifications@github.com wrote:

@jywarren https://github.com/jywarren Is it possible that to put
node_id in tweets?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-405091999,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ575zPOLYU6bpFdMMkZA0vl-Xg_Yks5uG0LpgaJpZM4TrSYe
.

@jywarren So publiclab.org/n/____ will present directly in tweet or there are some other links which redirect to this link as before?
ex:
screen shot 2018-07-17 at 2 07 32 am

I was researching and found that all the links that comes in tweet through twitter api is a twitter link which gets redirected to actual page. I was wondering if we use link to find the node and tweet contains more than one public.org/n/__(one for referencing post on public lab and other may be used in any of node content on public lab post itself) then in that case comment may get added to the wrong node because we donot know what the actual node we should add this comment? What do you think?
screen shot 2018-07-17 at 3 40 13 am
screen shot 2018-07-17 at 3 40 23 am

@jywarren So, by which way should i implement it ? using node_id or the other way. I am finalising the way of implementation.

This is a bit more complex when we don't have the auto-tweeting happening,
because we don't get to format the original. I can bring it up on our staff
call or open call today (https://publiclab.org/opencall) and we can try to
figure out a good way forward!

On Mon, Jul 16, 2018 at 6:20 PM Naman Gupta notifications@github.com
wrote:

I was researching and found that all the links that comes in tweet through
twitter api is a twitter link which gets redirected to actual page. I was
wondering if we use link to find the node and tweet contains more than one
public.org/n/__(one for referencing post on public lab and other may be
used in any of node content on public lab post itself) then in that case
comment may get added to the wrong node because we donot know what the
actual node we should add this comment? What do you think?
[image: screen shot 2018-07-17 at 3 40 13 am]
https://user-images.githubusercontent.com/20709985/42786554-59b06d14-8974-11e8-96bd-e2c804da47c9.png
[image: screen shot 2018-07-17 at 3 40 23 am]
https://user-images.githubusercontent.com/20709985/42786555-59f820f0-8974-11e8-9aa8-ef78abc46dfe.png


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-405399249,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJwu8hr_XV85dxj3NlaTRgsBCaZ8jks5uHRF3gaJpZM4TrSYe
.

I am going to use twitter gem using which we can also do auto tweet --just let you know that we can do autotweeting without using any service. I will look for the way to format.

OK, so what we're thinking of is:

  1. start by implementing only replies by "recognized" twitter users, using the OAuth login system
  2. attempt to find tweets by isolating publiclab.org/n/_____
  3. could we display all comments in a list only to moderators and allow them to be "approved" somehow? Can you think through how that might work?
  4. if we do start allowing all tweeted replies, let's consider having a way to "turn it off" if we start to get a LOT of spam, that way we can try things out.
  5. are there ways to display an embedded tweet with its replies, and then, if there are tweeted replies, notify the original poster, but not actually copy them in?

I just had a call with @SidharthBansal. I asked about this. So we are not saving twitter handle right now which is require to recognise the users. I think we should save it somewhere so we can recognise it. @jywarren ?

@namangupta01 you can migrate the user tag model and add handler field.
If you need any further help feel free to contact me.
Thanks

Thanks Sidharth! :)

On Thu, Jul 19, 2018 at 9:55 PM Sidharth Bansal notifications@github.com
wrote:

https://github.com/publiclab/plots2/blob/master/doc/Omniauth.md
https://github.com/publiclab/plots2#ssl-in-development
publiclab/plots2#2893 https://github.com/publiclab/plots2/issues/2893
these will surely help you


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-406336137,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATwCYUJLLS9Lc722_YJWLBdLhWed_orrks5uILMDgaJpZM4TrSYe
.

I think request.env['omniauth.auth']["info"]["urls"]will work.

IMPORTANT: All the providers give different fields in their hash with different names. So, please take care of filling all other providers info -- url field as NULL if they are not twitter

See the hashes given here and compare:

https://github.com/arunagw/omniauth-twitter
https://github.com/mkdynamic/omniauth-facebook
https://github.com/omniauth/omniauth-github
https://github.com/zquestz/omniauth-google-oauth2

See that there hashes are different. Also, please take reviews from me in your prs. I will be happy to help.

Google_oauth2 also has same name --> info -->urls
But facebook has handler in extra_info. So, please fetch [extra][raw_info][link] and store in user_tag as handler.
Github --> It is not written in the documentation. May be it does not provide. Search if github provides than assign handler of github to this field
All those which can't be set in handler like Github you may put them as NULL.

@jywarren should i make separate column for every oauth?

user tag model and add handler field

I wonder if we could just create a set of additional custom oa- fields
for this info in a flat key:value system, rather than migrating the
database... Sidharth, what do you think?

On Thu, Jul 19, 2018 at 2:18 PM Naman Gupta notifications@github.com
wrote:

@jywarren https://github.com/jywarren should i make separate column for
every oauth?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-406368740,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ_XCeor_CeJB2aXO3eJHr0FJhX2rks5uIM1agaJpZM4TrSYe
.

We need not to complicate user_tag much. It should be easily understandable by the new comers.
We need to add fields a lot of times in the future. So, consider the situation that we did according to this approach, then providers will have value as uid:provider:handler. Github doesn't provides any handler. Now sitaution comes we need image to be displayed at profile page. So this will create problem. So then we need to migrate the db. So, my opinion is to migrate the db from now.

We need to see the situation where in future we need to implement posts in and out of fb or twitter after logging in then also, we will need other fields. We can't make the value longer

Flat system is also a good option. But I am concerned about the better readability of the user_tags for the future.

Let's think this through -- what modification exactly to the user_tag model are you looking for? Could we add just one text column, and store JSON in it? I'm trying to think of the most maintainable and flexible way, so we don't have a lot of very specific features on the user_tag model that won't be re-usable for different purposes. Make sense?

Thanks, all!

@jywarren yeah I got your point. Let's append the user_tag's val field.

I do think using a longer text field could be useful for lots of things, so
if you want to just have a collection of other things to store along with
the key:value, we could do that...

On Thu, Jul 19, 2018 at 6:00 PM Sidharth Bansal notifications@github.com
wrote:

@jywarren https://github.com/jywarren yeah I got your point. Let's
append the user_tag's val field.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-406427465,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ4Hlow0UZgw-e-I0WBp9Lpt0MiC0ks5uIQFKgaJpZM4TrSYe
.

@SidharthBansal Everytime i do login via twitter on local it redirect to public lab website. Any idea?

I guess i Got it why it is occuring

@SidharthBansal i am getting this error kindly help:
screen shot 2018-07-21 at 12 28 05 am

screen shot 2018-07-21 at 12 30 17 am

Add advance settings to allow https for unsecure websites

127.0.0.1:3001 is unsecure

Resolved thanks @SidharthBansal 👍

@jywarren I was today searching for how the flat system can be achieved.
The following file is the main file in my Soc Project.
https://github.com/publiclab/plots2/blob/f2fe98da351a562152a85bd068acb1a9e6e7f7c0/app/models/user_tag.rb#L24-L30
If we do append the string then the whole Soc Project will need update at multiple positions. Also all tests will fail. We need to write all the tests again.
@namangupta01 what do you suggest?
If we create a new field in the db then Soc project can be modified without any conflicts. All the tests and code for Soc Project will remain as it is.

I think @jywarren said here that can we add new text field where we can store JSON object that we are getting in response.

Let's think this through -- what modification exactly to the user_tag model are you looking for? Could > we add just one text column, and store JSON in it? I'm trying to think of the most maintainable and > > flexible way, so we don't have a lot of very specific features on the user_tag model that won't be
re-usable for different purposes. Make sense?

Am i right @jywarren ?

Lets wait for jeffs input.

Yes......

My another concern is that when we will poll for new replies on twitter in every 5 seconds or in every 10 seconds we are going to find if particular handle exist or not in database. Suppose in every response we got some replies and then we have to find the handles for that we will be parsing the text field for extracting the handle and to check if that handle exist or not. Would it increase the time complexity of the system? Because for every handle checking we will be doing O(n) work? And also no indexing would work in this case to make the db transaction faster.
Sorry @jywarren this is taking some time because i want to be fully confirmed about the implementation before opening the pr since it is going to be complex system.

Hi! Yes, i was saying that if there is a lot of content you want to store
together in a less-flat way, we could make a data text column in the
user_tag table, and store JSON in it. But can you offer a clear example of
the kind of data you want to be storing so we know if it's the appropriate
way to store it? Thanks!

For the complexity, i agree, this could create significant load. Can you
write pseudocode for the series of queries and I can help optimize? I'm
thinking, we could craft a more efficient query, but help me figure out the
desired steps first. Thanks!

On Fri, Jul 20, 2018 at 4:00 PM Naman Gupta notifications@github.com
wrote:

My another concern is that when we will poll for new replies on twitter in
every 5 seconds or in every 10 seconds we are going to find if particular
handle exist or not in database. Suppose in every response we got some
replies and then we have to find the handles for that we will be parsing
the text field for extracting the handle and to check if that handle exist
or not. Would it increase the time complexity of the system? Because for
every handle checking we will be doing O(n) work? And also no indexing
would work in this case to make the db transaction faster.
Sorry @jywarren https://github.com/jywarren this is taking some time
because i want to be fully confirmed about the implementation before
opening the pr since it is going to be complex system.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-406711222,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ7Z9x-9Cwedez8T-gsMnYR4VQ75zks5uIjbCgaJpZM4TrSYe
.

Pseudocode:

  1. Fetch latest replies from Twitter :
  2. For every reply in replies :
    check if it belongs to any node or post using publiclab.org/n/_____ and if that node exists then find if the user exist using tweet replier. If user exists add the comment.
    tweets = client.search("to:publiclab", since_id: 23423423).collect do |tweet| node = Node.where(some_condition) #To find if node exists if node.any? node = node.first tweet_user = tweet.user UserTag.all.each do |user_tag| if(some_condtion_to_check if user handle exists) add_comment end end end end

As of now i only need to store twitter handle but don't know what feature
we want in future like profile picture and more?

On Sat, Jul 21, 2018 at 1:52 AM Jeffrey Warren notifications@github.com
wrote:

Hi! Yes, i was saying that if there is a lot of content you want to store
together in a less-flat way, we could make a data text column in the
user_tag table, and store JSON in it. But can you offer a clear example of
the kind of data you want to be storing so we know if it's the appropriate
way to store it? Thanks!

For the complexity, i agree, this could create significant load. Can you
write pseudocode for the series of queries and I can help optimize? I'm
thinking, we could craft a more efficient query, but help me figure out the
desired steps first. Thanks!

On Fri, Jul 20, 2018 at 4:00 PM Naman Gupta notifications@github.com
wrote:

My another concern is that when we will poll for new replies on twitter
in
every 5 seconds or in every 10 seconds we are going to find if particular
handle exist or not in database. Suppose in every response we got some
replies and then we have to find the handles for that we will be parsing
the text field for extracting the handle and to check if that handle
exist
or not. Would it increase the time complexity of the system? Because for
every handle checking we will be doing O(n) work? And also no indexing
would work in this case to make the db transaction faster.
Sorry @jywarren https://github.com/jywarren this is taking some time
because i want to be fully confirmed about the implementation before
opening the pr since it is going to be complex system.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/publiclab/plots2/issues/2671#issuecomment-406711222
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AABfJ7Z9x-9Cwedez8T-gsMnYR4VQ75zks5uIjbCgaJpZM4TrSYe

.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-406716657,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATwCYaP_Iy1H4Uxs83vmG95ucdrSLgxtks5uIjwCgaJpZM4TrSYe
.

HI @jywarren I have added migration to save JSON for omniauth response in #3117 just to give it a start...let me know if needs any change?

@jywarren any review and feedback regarding pseudocode and pr?

i am hoping to complete this as soon as possible.

Can you share a typical JSON output that'd be stored in this new column, so we can see? Thanks!

For the pseudocode, could you do something like:

since = comments.where(since_id not null).last # get most recent comment-from-tweet time
tweets = client.search("to:publiclab", since_id: 23423423).collect do |tweet|
 node = Node.where(some_condition) #To find if node exists
 if node.any?
   node = node.first
   tweet_user = tweet.user
   ruser = UserTag.find_by(twitter_id: tweet.user)
   add_comment(since_id: since, ruser) unless ruser.nil? 
end
end

It might be more optimal?

Here's is the sample JSON:
````
{
"provider":"twitter",
"uid":"849503183529545728",
"info":{
"nickname":"itsmenamangupta",
"name":"Naman Gupta",
"email":"[email protected]",
"location":"",
"image":"http://pbs.twimg.com/profile_images/950001110378401793/mBAtBXyI_normal.jpg",
"description":"GSoC'18 @PublicLab",
"urls":{
"Website":"https://t.co/fqLSxIlYFH",
"Twitter":"https://twitter.com/itsmenamangupta"
}
},
"credentials":{
"token":"849503183529545728-fgqcxtgihvrrKd2icj67QpspT5bKntD",
"secret":"ZDTD5HsexliY2Tnrv6aSEVSqPVvbDLY2YDW9S5VeDmmyK"
},
"extra":{
"access_token":{
"token":"849503183529545728-fgqcxtgihvrrKd2icj67QpspT5bKntD",
"secret":"ZDTD5HsexliY2Tnrv6aSEVSqPVvbDLY2YDW9S5VeDmmyK",
"consumer":{
"key":"H59J9kJBVQvtZvWhr2SUAht4o",
"secret":"GEQOygPITjGj2Imzg5ALJeCqE0GdQU2GAmTYOS9kEPcLVlMxQu",
"options":{
"signature_method":"HMAC-SHA1",
"request_token_path":"/oauth/request_token",
"authorize_path":"/oauth/authenticate",
"access_token_path":"/oauth/access_token",
"proxy":null,
"scheme":"header",
"http_method":"post",
"debug_output":null,
"oauth_version":"1.0",
"site":"https://api.twitter.com"
},
"debug_output":null,
"http":{
"address":"api.twitter.com",
"port":443,
"local_host":null,
"local_port":null,
"curr_http_version":"1.1",
"keep_alive_timeout":2,
"last_communicated":null,
"close_on_empty_response":false,
"socket":null,
"started":false,
"open_timeout":30,
"read_timeout":30,
"continue_timeout":null,
"debug_output":null,
"proxy_from_env":true,
"proxy_uri":null,
"proxy_address":null,
"proxy_port":null,
"proxy_user":null,
"proxy_pass":null,
"use_ssl":true,
"ssl_context":{
"verify_mode":0,
"verify_hostname":true
},
"ssl_session":{

           },
           "sspi_enabled":false,
           "ca_file":null,
           "ca_path":null,
           "cert":null,
           "cert_store":null,
           "ciphers":null,
           "key":null,
           "ssl_timeout":null,
           "ssl_version":null,
           "verify_callback":null,
           "verify_depth":null,
           "verify_mode":0
        },
        "http_method":"post",
        "uri":"https://api.twitter.com"
     },
     "params":{
        "oauth_token":"849503183529545728-fgqcxtgihvrrKd2icj67QpspT5bKntD",
        "oauth_token_secret":"ZDTD5HsexliY2Tnrv6aSEVSqPVvbDLY2YDW9S5VeDmmyK",
        "user_id":"849503183529545728",
        "screen_name":"itsmenamangupta"
     },
     "response":{
        "cache-control":[
           "no-cache, no-store, must-revalidate, pre-check=0, post-check=0"
        ],
        "connection":[
           "close"
        ],
        "content-disposition":[
           "attachment; filename=json.json"
        ],
        "content-length":[
           "664"
        ],
        "content-type":[
           "application/json;charset=utf-8"
        ],
        "date":[
           "Sat, 21 Jul 2018 10:51:03 GMT"
        ],
        "expires":[
           "Tue, 31 Mar 1981 05:00:00 GMT"
        ],
        "last-modified":[
           "Sat, 21 Jul 2018 10:51:03 GMT"
        ],
        "pragma":[
           "no-cache"
        ],
        "server":[
           "tsa_k"
        ],
        "set-cookie":[
           "personalization_id=\"v1_pEJH6fv6zGSET2PG1MYRCw==\"; Expires=Mon, 20 Jul 2020 10:51:03 GMT; Path=/; Domain=.twitter.com",
           "lang=en; Path=/",
           "guest_id=v1%3A153217026311648297; Expires=Mon, 20 Jul 2020 10:51:03 GMT; Path=/; Domain=.twitter.com"
        ],
        "status":[
           "200 OK"
        ],
        "strict-transport-security":[
           "max-age=631138519"
        ],
        "x-access-level":[
           "read-write-directmessages"
        ],
        "x-connection-hash":[
           "cf7caac1e8db2d46c6043fb2287ca32b"
        ],
        "x-content-type-options":[
           "nosniff"
        ],
        "x-frame-options":[
           "SAMEORIGIN"
        ],
        "x-rate-limit-limit":[
           "75"
        ],
        "x-rate-limit-remaining":[
           "71"
        ],
        "x-rate-limit-reset":[
           "1532170356"
        ],
        "x-response-time":[
           "238"
        ],
        "x-transaction":[
           "0085940a005f5411"
        ],
        "x-twitter-response-tags":[
           "BouncerExempt",
           "BouncerCompliant"
        ],
        "x-xss-protection":[
           "1; mode=block; report=https://twitter.com/i/xss_report"
        ]
     }
  },
  "raw_info":{
     "id":849503183529545728,
     "id_str":"849503183529545728",
     "name":"Naman Gupta",
     "screen_name":"itsmenamangupta",
     "location":"",
     "description":"GSoC'18 @PublicLab",
     "url":"https://t.co/fqLSxIlYFH",
     "entities":{
        "url":{
           "urls":[
              {
                 "url":"https://t.co/fqLSxIlYFH",
                 "expanded_url":"http://www.namangupta.me",
                 "display_url":"namangupta.me",
                 "indices":[
                    0,
                    23
                 ]
              }
           ]
        },
        "description":{
           "urls":[

           ]
        }
     },
     "protected":false,
     "followers_count":16,
     "friends_count":32,
     "listed_count":0,
     "created_at":"Wed Apr 05 06:05:16 +0000 2017",
     "favourites_count":86,
     "utc_offset":null,
     "time_zone":null,
     "geo_enabled":false,
     "verified":false,
     "statuses_count":42,
     "lang":"en",
     "contributors_enabled":false,
     "is_translator":false,
     "is_translation_enabled":false,
     "profile_background_color":"000000",
     "profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png",
     "profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png",
     "profile_background_tile":false,
     "profile_image_url":"http://pbs.twimg.com/profile_images/950001110378401793/mBAtBXyI_normal.jpg",
     "profile_image_url_https":"https://pbs.twimg.com/profile_images/950001110378401793/mBAtBXyI_normal.jpg",
     "profile_link_color":"FFFFFF",
     "profile_sidebar_border_color":"000000",
     "profile_sidebar_fill_color":"000000",
     "profile_text_color":"000000",
     "profile_use_background_image":false,
     "has_extended_profile":true,
     "default_profile":false,
     "default_profile_image":false,
     "following":false,
     "follow_request_sent":false,
     "notifications":false,
     "translator_type":"none",
     "suspended":false,
     "needs_phone_verification":false,
     "email":"[email protected]"
  }

}
}
````

Yes we can use the code specified by you, we will need twitter_id column in user_tag table?

yeah, the problem is you can't search by the json, probably... you could
full text search but it's a bit expensive, right? @sidharthBansal - what do
you think is a good approach here?

On Mon, Jul 23, 2018 at 3:49 PM Naman Gupta notifications@github.com
wrote:

Yes we can use the code specified by you, we will need twitter_id column
in user_tag table?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-407178930,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJxV7kQpSKvSyCCpDQlFN6fWT_-yqks5uJiibgaJpZM4TrSYe
.

Yes, it would make it expensive.
Adding direct username to column for all oauth services would help?

Hi guys, just want to remind that we store, usernames for various social accounts in usertags too, so if you guys decide on switching to tables for storing username then, please open a follow-up issue to merge that system. Thanks!

Would it be worth auto-generating the [twitter:jywarren] style tag from the
OA system? We do need to be careful that nobody falsely associates their
account using the [twitter:jywarren] style tags, so maybe we need to
combine these; Gaurav, could you explain a little about how that system
works?

On Mon, Jul 23, 2018 at 4:39 PM Gaurav Sachdeva notifications@github.com
wrote:

Hi guys, just want to remind that we store, usernames for various social
accounts in usertags too, so if you guys decide on switching to tables for
storing username then, please open a follow-up issue to merge that system.
Thanks!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-407193340,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ79eJpa40xw7imZ_m2K8A2B3F4v0ks5uJjRdgaJpZM4TrSYe
.

Hi guys, just want to remind that we store, usernames for various social accounts in usertags too, so if you guys decide on switching to tables for storing username then, please open a follow-up issue to merge that system. Thanks!

Hi @Gauravano we are nowhere storing the usernames of the social media users till now. Currently only user id and provider name is saved.
@Gauravano can you please elaborate what issue are you pointing to? We are not making new tables. We are migrating the usertag.

Yes we can use the code specified by you, we will need twitter_id column in user_tag table?

yeah, the problem is you can't search by the json, probably... you could full text search but it's a bit expensive, right? @SidharthBansal - what do you think is a good approach here?

@jywarren, @namangupta01 we can store the username.

We do need to be careful that nobody falsely associates their account using the [twitter:jywarren] style tags, so maybe we need to combine these?

I have sent a pr in April for this case. No one is able to create any tag with name oauth:________
So, no need to worry about this issue. You can check this thing by going to the profile page.
Screenshot for better understanding.
image

Would it be worth auto-generating the [twitter:jywarren] style tag from the OA system?

@jywarren We are currenlty generating the OAuth usertags from OAuth ONLY. There is no other way to generate them.

Adding direct username to column for all oauth services would help?

Adding multiple columns again and again would not help. I will strongly suggest to store the entire hash and use what we need whensoever need arises. For example, after naman uses handler from auth hash. We can use the image from the image url to display on public lab profile page. We currently use Gravatar.

Related issue #3125
We are storing the handler. Some providers allow the user to change their handler. So, we need a method to change the auth hash either every time when the user logs in OR when the auth expires. The auth gives the expire date and time. So we can use that and refresh the auth hash accordingly. Please discuss this subissue stuff in #3125 so that we could stick to user_tag migration in this issue.

Thanks

Hi @jywarren @SidharthBansal @namangupta01, I was referring to this system -

We provide PL users to enter their various social media usernames like this-
this_one

User add the social platform as a key and his username as a value-
user_2

After that usertag is added to his profile-
profile_tags

Thanks!

@Gauravano I guess Using this will not be a good because i can be able to add any username i want ?

As the @jywarren we should merge the OA system with it?

OK, storing the hash makes sense - why do the extra converting, right? Cool.

And +1 merging these systems. The earlier system is great but would benefit from integration here for the reasons above! Thanks, everyone!

yeah storing hash seems good option👍

On Tue, Jul 24, 2018 at 10:45 PM Jeffrey Warren notifications@github.com
wrote:

OK, storing the hash makes sense - why do the extra converting, right?
Cool.

And +1 merging these systems. The earlier system is great but would
benefit from integration here for the reasons above! Thanks, everyone!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2671#issuecomment-407482926,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATwCYU7kYuvbVUbybfTrYum5r2lVLYevks5uJ1Y-gaJpZM4TrSYe
.

@jywarren @Gauravano @SidharthBansal can you guys please tell me how to get hash from the string saved in db because i am not able to find a way? Thanks

Hi @Gauravano I will highly recommend you to open another issue for merge of Social Media icons with OA and link it here so that the discussion will not be divergent.
Thanks for the nice suggestion.

Hi @SidharthBansa i already tried the above links but they didnt work

I got the problem..we have to explicitly convert the auth variable to hash to work it out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

first-timers[bot] picture first-timers[bot]  ·  3Comments

grvsachdeva picture grvsachdeva  ·  3Comments

divyabaid16 picture divyabaid16  ·  3Comments

jywarren picture jywarren  ·  3Comments

grvsachdeva picture grvsachdeva  ·  3Comments