+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Would like suggestions on custom-RSS feeds and using tags.

  1. #1

    Default Would like suggestions on custom-RSS feeds and using tags.

    I've searched through the site and forums and have not found answers to my questions below. I'm very sorry if I've missed something.

    How would you suggest creating custom RSS feeds?
    I would like to create multiple RSS feeds of most recently changed or added articles out of one wiki. I could create users for each topic and create a watchlist, but the watchlist will not include created articles. I could tag articles for each topic based on genre, but there is no automatic tagging of new pages and I'm not sure how to create an RSS feed out of a tag.

    Can you create chronotags for sub-sections of an article?
    What I'd like to do is have multiple (depending on the topic) "on this day in history" pages -- and add chronotags for each sub-section (each would be one day). Then, I'd like to display on the homepage a general "on this day" that is automatic out of anything tagged with that specified chronotag. Not sure this is possible, but I figured I'd put it out there for suggestions.

    Finally, is there a way to embed an automatic list of articles given a certain tag?
    I know that a define page for a tag will automatically show at the bottom of the article. What I'd like to do is have a tag called "featured" and any articles given that tag will automatically show up in a list on the wiki home page of articles given featured status. The ability to randomly display the first two sentences of an article tagged "featured" would be even better.

    Sorry for all my questions, and again, I apologize if these questions have been asked elsewhere.

    Thanks

    _Sonya, twitter.com/sonyanews
    Last edited by sonyanews; 07-01-2009 at 09:52 PM. Reason: made mistake the first time

  2. #2
    Join Date
    May 2009
    Location
    Houston, Tx
    Posts
    237

    Default

    With the tag question:
    Code:
    <ul>;
    foreach (var p in wiki.gettag("foo").pages) {
      <li>p.title</li>;
    }
    </ul>;
    will build an unordered list from pages tagged with 'foo'
    More information on this found here: http://developer.mindtouch.com/DekiS...es/Wiki.GetTag

    There is already an RSS feed for recent changes on the /Special:Recentchanges page
    Last edited by blakeh; 07-01-2009 at 10:12 PM. Reason: More information

  3. #3
    Join Date
    Feb 2007
    Location
    San Diego, CA
    Posts
    132

    Lightbulb Custom RSS

    For completely custom RSS feeds you can trying something like this:

    Code:
    <h1>Template:CustomRSS</h1>
    <pre class="script">
    
    var feedurl = $url ?? 'http://www.customrssfeed/rss';
    
    var posts = web.xml{source:feedurl, ttl:200};
    let posts = posts['_:channel/_:item'];
    
    <ul>
    	foreach (var post in posts where __count <3) {
    	var title = xml.text(post,'title');
    	var uri = xml.text(post,'link');
    	
    	<li>
    		<a href=(uri)>title</a>
    	</li>
    	}
    </ul>
    </pre>
    Please keep in mind that RSS feeds can all have unique markup so you'll need to look at the xml to properly parse it. Lastly in this example the use of $url allows you to pass in a parametrized url so you can call this template from any other MindTouch page.

    Hope that helps
    I do HTML, CSS, Jquery and DekiScript. I designed Fiesta and enjoy building apps on top of MindTouch.

    Thanks for your contribution,

    Damien Howley
    @DamienH

  4. #4

    Default

    Thanks so much Blakeh!

    The code for inserting a list of tagged pages is great. Thanks for finding that for me. On the RSS feed, I'm looking to find a way to have multiple-topic-driven RSS feeds out of the wiki beyond the one, generic recent changes feed. I'd like to use the wiki tool to build these custom-RSS feeds -- rather than use my other option which is yahoo pipes.

    _Sonya

  5. #5

    Default

    Thanks so much Howleyda! I'll try that out and will post an update on what I get.

  6. #6
    Join Date
    Feb 2007
    Location
    San Diego, CA
    Posts
    132

    Wink wiki.getSearch()

    sonyanews, you can also try wiki.GetSearch() which can easily be controlled by DekiScript and is extremely efficient. It leverages Lucene so you can access a lot of information. Here's a non-tested example below.

    Code:
    var pages = wiki.getsearch("help");
    foreach(var pg in pages){
    <a href=(pg.uri)>pg.title</a><br/>
    }
    Additionally you can specify other things like tags and paths

    Code:
    var pages = wiki.getsearch("tag:documentation");
    Code:
    var pages = wiki.getsearch("path:tutorials/*");
    I do HTML, CSS, Jquery and DekiScript. I designed Fiesta and enjoy building apps on top of MindTouch.

    Thanks for your contribution,

    Damien Howley
    @DamienH

  7. #7

    Default

    Thanks for the additional information!

  8. #8

    Default

    I've tried both methods of displaying a list of tags -- yes I'm getting a list of pages tagged "featured" -- but I cannot add spaces between each page title and the page titles are not linked. Sorry for my simple questions -- I'm new to Mindtouch. Here's the URL where I inserted both codes: http://wiki.ocregister.com/About_the...x:_Total_edits

  9. #9
    Join Date
    May 2009
    Location
    Houston, Tx
    Posts
    237

    Default

    can you post the code?

  10. #10

    Default

    Here is the code that contains both attempts:

    Code:
    <p>FEATURED PAGES</p>
    <ul>;
    foreach (var p in wiki.gettag("featured").pages) {
      <li>p.title</li>;
    }
    </ul>;
    <p>XXXXXXXXX FEATURED PAGES (2){</p>
    <p>{{ var pages = wiki.getsearch("tag:featured"); foreach(var pg in pages){ <a href="mks://localhost/(pg.uri)" title="(pg.uri)">pg.title</a><br />
    } }}</p>

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts