reposter | deploy marketing in social-media by re-posting content | REST library
kandi X-RAY | reposter Summary
kandi X-RAY | reposter Summary
A framework to manage, monitor and deploy marketing in social-media by re-posting content from one place to the another.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Executes the given job
- Post a post
- Get all the posts from subreddits
- Log a post
- Save a gif file
- Parse url
- Post video to Facebook
- Return the first post
- Submits the given list of posts
- Post a gif
- Download a gif file
- Retrieve a list of posts
- Creates a list of posts
- Returns a list of submitted submissions
- Guess the type of the URL
- Write data to file
- Get json data from file
- Returns an access token by id
- Get long access token
reposter Key Features
reposter Examples and Code Snippets
Community Discussions
Trending Discussions on reposter
QUESTION
I want to implement retweet feature in my app. I use Mongoose
and have User
and Message
models, and I store retweets as array of objects of type {userId, createdAt}
where createdAt
is time when retweet occurred. Message model has it's own createdAt
field.
I need to create feed of original and retweeted messages merged together based on createdAt
fields. I am stuck with merging, whether to do it in a single query or separate and do the merge in JavaScript. Can I do it all in Mongoose with a single query? If not how to find merge insertion points and index of the last message?
So far I just have fetching of original messages.
My Message
model:
ANSWER
Answered 2020-Feb-02 at 12:56This can be done in one query, although its a little hack-ish:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install reposter
Additional notes: To run: docker-compose up after you're done with the authentication setup. By default it runs an application scheduler: Application Scheduling You can make it run regular index setup by swapping line CMD [ "python", "./schedule_index.py" ] in Dockerfile-reposter with CMD [ "python", "./index.py" ]
Clone the repository: git clone github.com/slapbot/reposter
Cd into the directory: cd reposter
Create a virtualenv for python: python -m venv reposter-env
Activate the virtualenv: Linux: source reposter-env/bin/activate Windows: source reposter-env/Scripts/activate
Upgrade your pip to latest version: pip install --upgrade pip
Install the application level dependencies: pip install -r requirements.txt
Create a Reddit bot and add in the credentials at: config.ini under [REDDIT] section. allowed_domain: Enter the domains that you want to parse for content retrieval.
Add in your page information at config.ini as a section like [STEPHANIE] shown in the example. Next add in your credentials after creating an app at facebook. Fill in the app_id and app_secret from facebook console. Fill in the short_token which will act as user-access-token from Graph API Console Ensure that you give it these permissions email manage_pages pages_manage_cta pages_show_list publish_pages publish_to_groups public_profile
Write the workflow logic in declarative syntax of json at information.json as follows: There is already an example to showcase the working. facebook tag encapsulates all of the information needed for Facebook workflow. Name: Name of the facebook page. page_id: ID of the facebook page. token: leave it blank for now. message: If you'd wanna write the message retrieved from the posts (from Reddit or any other content aggregator). subreddits tag allows you to mention the subreddits from where you'd wanna retrieve the posts from.
Run python facebook_perm_token.py to get a permanent page access tokens for each page which will automatically be inserted in informations.json file.
Now you must be able to run python index.py to automate the process of re-posting from one social media handle to another.
Throughout the code you can abstract a lot of entries to the information.json like which posts to choose from Reddit (currently its the top rated one.)
Adding new social media handles for retrieval and submission is super easy: Create their own module and add the hooks at information.json Regulate their separate logic in a much more modular way.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page