<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

import json

from linkedin import linkedin

from socialbot.utils import get_config

API_KEY = '<KEY>'
API_SECRET = '<KEY>'
RETURN_URL = 'https://devecoop.slack.com/'


class LinkedinPlugin(object):
    ACTION_NAME = 'Linkedin-post'

    def do(self, text, link):
        config = get_config()
        authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
        application = linkedin.LinkedInApplication(authentication)

        json.shareObj({'comment':  str(text)+str(link), 'visibility': {'code': 'anyone' }})

        application.submit_share(json.shareObj)<commit_msg>testing quick authentication for linkedin plugin<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

import json

from linkedin import linkedin, server

from socialbot.utils import get_config

RETURN_URL = 'https://devecoop.slack.com/'
API_KEY = '<KEY>'
API_SECRET = '<KEY>'


class LinkedinPlugin(object):
    ACTION_NAME = 'Linkedin-post'

    def do(self, text, link):
        config = get_config()

        #authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
        #application = linkedin.LinkedInApplication(authentication)
        application = server.quick_api(API_KEY, API_SECRET)

        application.get_profile()
        #json.shareObj({'comment':  str(text)+str(link), 'visibility': {'code': 'anyone' }})

        #application.submit_share(json.shareObj)

if __name__=="__main__":
    plugin = LinkedinPlugin()
    plugin.do("text", "link")
{'fraction_non_alphanumeric': 0.13608374384236452, 'fraction_numerical': 0.0012315270935960591, 'mean_word_length': 4.17515923566879, 'pattern_counts': {'":': 1, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '957645', 'n_tokens_mistral': 528, 'n_tokens_neox': 512, 'n_words': 99}