Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Jun 19, 2024
1 parent 6fd5985 commit cd95194
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions qgisfeedproject/qgisfeed/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,53 +44,3 @@ def get_field_max_length(ConfigurationModel: Model, field_name: str):
return config.max_characters
except ConfigurationModel.DoesNotExist:
return 500


def push_to_linkedin(title, content):
access_token = 'YOUR_ACCESS_TOKEN'
headers = {
'Authorization': f'Bearer {access_token}',
'Content-Type': 'application/json',
'X-Restli-Protocol-Version': '2.0.0'
}
payload = {
"author": "urn:li:person:YOUR_PERSON_URN",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": title + content
},
"shareMediaCategory": "NONE"
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
response = requests.post('https://api.linkedin.com/v2/ugcPosts', headers=headers, json=payload)
return response.json()


def push_to_facebook(title, content):
access_token = 'YOUR_ACCESS_TOKEN'
page_id = 'YOUR_PAGE_ID'
url = f'https://graph.facebook.com/{page_id}/feed'
payload = {
'message': title + content,
'access_token': access_token
}
response = requests.post(url, data=payload)
return response.json()


def push_to_telegram(title, content):
bot_token = 'YOUR_BOT_TOKEN'
chat_id = 'YOUR_GROUP_CHAT_ID'
url = f'https://api.telegram.org/bot{bot_token}/sendMessage'
payload = {
'chat_id': chat_id,
'text': title + content
}
response = requests.post(url, data=payload)
return response.json()

0 comments on commit cd95194

Please sign in to comment.