atlassian_python_api checking if blogpost exist - python-3.8

I'm using atlassian-pytho-api version 3.4.1.
I need to create a blogpost which I successfully made this way
confluence.create_page(space, title, content, type="blogpost")
Now, I want to update this blogpost under certain conditions, for that i need to check if the post exists or not. I tried using
confluence.page_exists(space, title)
But it just searches in PAGES not in the blogpost and hence couldn't find the post and I can't update. Is there any way to restrict page_exists to search in blogpost instead of pages ?

i used CQL to search through whole space.
space={SPACE_NAME} and type="blogpost and title~{PAGE_TITLE}"

Related

[Mendeley API]: How to search for partial terms

I am using the Mendeley API to retrieve documents in the profile of a user.
Specifically, I am using this API:
GET https://api.mendeley.com/search/documents?view=all&limit=25&title=ONTOLOGY
I would like to search for all the documents that match a partial term, i.e. instead of the full word "ONTOLOGY" I would like to get the same result if I do an HTTP call like
GET https://api.mendeley.com/search/documents?view=all&limit=25&title=ONTOLO
How can I achieve that?
Should I put any jolly character?
I tried
ONTOLO*
ONTOLO$
ONTOLO?
with no luck.
I haven't found any documentation related to this feature.
Thanks!!

Show content based on whether the user has certain tag in Mailchimp

I went through the Merge Tags here and here, but couldn't figure out the syntax that would allow me to show content based on whether the user has certain Tag or not.
Help?
My goal in case it helps:
User subscribes, and is queued for a welcome mail one day later. In meantime that user may get tagged (my way of segmenting them), and so, the next day when that user receives the welcome mail, the content needs to be catered based on the tag that user got.
Got a response from their support saying
merge tags do not work with Tags just yet
here's the whole thing:
While we do have conditional merge tags available, I'm afraid we do
not have any that would work with Tags. To be transparent, Tags were
recently added a few months ago, and there are some features in our
application that has not updated to work with Tags just yet.
Because conditional merge tags do not work with tags yet, the best
option would be to create multiple automations and send them out based
on each tags. If you do it that way, you'll be able to target those in
specific tags with specific content
Dug a little deeper from the first link. There is another link Use Conditional Merge Tag Blocks which contained the below code:
Name
IF-ELSE
Definition
Use ELSE to indicate alternative content to display if the *|MERGE|* tag value is false.
Example
*|IF:MERGE|* content to display *|ELSE:|* alternative content to display *|END:IF|*
Name
ELSEIF
Definition
Use ELSEIF to specify a new *|MERGE|* tag to be matched against if the first *|MERGE|* tag value is false.
Example
*|IF:TRANSACTIONS >= 20|* Enjoy this 40% off coupon! *|COUPON40|*
*|ELSEIF:TRANSACTIONS >= 10|* Enjoy this 20% off coupon! *|COUPON20|*
*|ELSE:|* Enjoy this 10% off coupon! *|COUPON10|* *|END:IF|*
More examples with definitions can be found here.
Hope this is the answer you were after.

How to get all Wikipedia page links with their pageIDs?

Starting a request like that:
https://en.wikipedia.org/w/api.php?action=query&format=json&titles=Title&prop=links&pllimit=500
provides me a list of links (that the page contains) where every link consists of the title and the ns (namespace)
Is there a way to also get the PageID together with title & ns? (the less work it is for the sever the better of course)
You need to use generator parameter. Here is an example for Cobra Wikipedia page.
https://en.wikipedia.org/w/api.php?action=query&generator=links&titles=Cobra&prop=info&gpllimit=500

sharepoint crawl rule to exclude AllItems.aspx , but get an item/document in search resu lts if queried in the search box

I followed this blog Tips 1and created a crawl rule http://.*forms/allitems.aspx and ran full crawl. I no longer get the results with AllItems.aspx. However, if there is any document with name Something.doc in a Document Library , it no longer gets pulled in the search results.
I think what I desire is a basic functionality, like the user should not get to see Allitems.aspx in the search results but should get the item/document with names entered in the search box.
Please let me know if I am missing anything. I have already put in 24 hours...googled the max I could.
It seems that an Index Reset is required. Here's the steps I did:
1. Add the following crawl rule to exclude: *://*allitems.aspx.
2. Index Reset.
3. Full Crawl.
I could not find a good way to do this using crawl rules. Instead, I opted to set up a restriction on the search results web part.
In the search results web part properties, select "Change Query"
Add a property filter to exclude anything with "AllItems" (and any other exclusions you want in place.
Used Steve Mann's blog as a reference and for the images: http://stevemannspath.blogspot.com/2013/04/sharepoint-2013-search-removing-junk.html

Creating tags on posts RAILS

I am making something that's like that autocomplete tags field for the posts on stackoverflow.com
I want to make it so that when you make a blog post, you can tag it with words in a database, similar to SO.
For the posts, it belongs_to_and_has_many tags
For the tags, it belongs_to_and_has_many posts
However it is a problem for me to do it on the same page because #post would be nil.
How can I implement this?
(If someone can give me the code for the stackoverflow ask question page that would be AWESOME)
I think the problem here is that it seems like you are asking two different questions. Please correct me if I'm wrong on this.
The first question is how you would implement the autocomplete feature to allow users to easily select from a pre-populated list of tags. To answer this, you might refer to spncrgr's answer above.
The second question is how to deal with associating these retrieved tags to the current post. For this you can add additional javascript functionality to your autocomplete solution. When a user selects which tag they want from the autocomplete field, you can do like StackOverflow does and add the tag to a list of tags in a single text field. These can be either space or comma delimited. When you submit the form to create the new post, you can parse this field into it's separate tags:
tags = params[:tags].split(' ')
You can then associate these tags to the model in the Post#create action.
This may not help you at all (or you may have already seen it), but here's a link to a Railscasts' episode on auto-complete:
http://railscasts.com/episodes/102-auto-complete-association
I know it helped me when trying to do something similar.
HTH
It looks for me like you want to generate tags automatically.
You could create
class Post
before_save :create_tags
private
def create_tags
# get your tags somehow
self.tags << Tag.new(:text=>"...")
end
end
method in models/post.rb and build them there.
If you want to search among existing tags for your auto-suggest, you should have it match from Tag.all, as that won't be nil, just as you would collect a group of objects in a select drop down. Not sure about the code for auto-complete, but the tags should be in the Tag table.