How to delete all unpublished post in Sitefinity? - sitefinity

I have 100s of blog posts in unpublished status. What is the best way to delete all unpublished blog posts in Sitefinity? I am in version 9.1.6100.0.

You can create a simple widget that deletes all unpublished blog posts using the Sitefinity API as shown here:
http://docs.sitefinity.com/for-developers-delete-blog-posts#deleting-all-blog-posts
Just make sure you add a Where clause for the blob post status being unpublished.
Then add the widget to a temp page and execute the delete logic.
Then remove the temp page.

Related

Can I have any way (such as an API) to count the like and react on my post in my page and use that count to store in my database to use it?

I want to create a post in my website and post/share it in my Facebook page. This can be live/video/image etc. The amount likes and reaction my post get in Facebook will need to be fetched and stored in my post related database of my website.
Is it somehow possible to do?
If it is possible then what tools or guideline I need to follow?
The easiest solution would be to save the post ID when you create a post (Which you will get if the post was successfully created via the API) docs
And when you want to get the likes, use that post ID and fetch the API for the information. docs

How to replace links on blog posts Shopify

I recently created a copy of my website from here https://www.thecolorkind.com/ to here: https://colorkindstudio.com/ and I moved all the blogs to this last domain but they have some links that still redirect to the old domain.
We have more than 200 posts and it will take sometime to update/replace each link on each post. So, is there a way to replace all the links on my blog posts https://colorkindstudio.com/blogs/news to have the new domain?
I have two approach to solve this.
You redirect/forward all the request from https://www.thecolorkind.com/ to https://colorkindstudio.com/
If you are using GoDaddy then this might help - https://in.godaddy.com/help/forward-my-domain-12123
Second approach is to use some JavaScript to see if an anchor tag have thecolorkind.com in it's href attribute and if it does then replace the link with colorkindstudio.com.
Let me know if tis helps or if you need more insights.

API Blueprint - How to perform a simple UPDATE

I have went through the documentation of Apiary but did not find out how to create a blue print to update a resource.
What I am trying to achieve here is a simple scenario such as having a list of users, being able to list them, retrieve a single user by id, define different attributes for that user, modify one-n attributes of that user (updating that user), and delete that user.
Could someone redirect me to some clear documentation or to a stackoverflow question that I have missed during my research and that would help me achieve this?
I think you have to use PUT or PATCH method for update resource. Look into this blog post here are some examples.

How to retrieve the published post in wordpress database?

I'm trying to build a custom script of mine and I need to retrieve data from a wordpress database. I have to get the posts content in the database, but when I surf through the wp_posts table in phpmyadmin I see that there are lots of rows with mostly the same content, saved drafts, auto saved posts and so on.
So what I want is a SQL command that will give me the content of the published post and ignore all the drafts and saved posts. It's basically the command that wordpress uses when displaying a post (it displays the final, published one).
Hopefully I was clear enough.
select * from wp_posts
where post_status = 'publish'
and post_type = 'post'

Facebook app to edit posts

Is it possible to make a Facebook app which edits user's post on his wall automatically (edits EVERY POST that user makes, app has user's permission and everything)
I don't think that's possible, but maybe I'm wrong?
Based on the Graph API docs, I actually think it could work.
Get the extended permission called
"offline_access". See
http://developers.facebook.com/docs/authentication/permissions
Periodically pull from
https://graph.facebook.com/PROFILE_ID/feed
to see if the user has posted new
posts.
If so, for each new post that has appeared:
Pull and store the text of the post.
Manipulate the text as desired.
Delete the original post using
"DELETE". See
http://developers.facebook.com/docs/api#deleting
Publish your modified version of the
post using "POST". See
http://developers.facebook.com/docs/api#publishing
#Jon: You cannot delete a post that your application has not published.
See here: https://developers.facebook.com/docs/reference/api/post/
No, it's not possible for security reasons. Even though you probably have the best of intentions, there are lots of people who unfortunately don't. The few ruin it for all.