Rss Crawler/Ticker

mehran's picture

Hi All,

I am trying to make a news ticker, I found a composition that already has this feature but it can not switch to next news article properly. What I want to do is, just show the first news article, both title and description, title stay still and description will crawl from right to left. When the first article went out of display, I want to switch to next one.

It is easy to send news article after specific interval, but what I found difficult is, how to tell application that this article has finished and now stop scrolling, and then switch to next article. I tried to simulate a delay mechanism or switch with javascript, but it wasn't successful.

It is difficult to say, now we have a new article, go and scroll one time, when done jump to next news and start scrolling. The interpolation mechanism should be in loop to work. If I use External Timebase, and try to control it with Stop Watch, then problem is how to start and reset that stop watch properly. I can't find any way to do that.

Both compositions that I have attached here, I found it here or through Google and unfortunately I can't remember the name of authors, so credit for most of sections goes to them.

Any help would be appreciated.

PreviewAttachmentSize
RSS_ticker.qtz16.65 KB
MultiPlayer RSS_02.qtz34.39 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

dust's picture
Re: Rss Crawler/Ticker

this might help. every 10 seconds the rss feed is updated looking for new info as well as changing the article. once all the articles have iterated then the rss feed starts over with updated info. pretty simple just some conditional logic, a stop watch and a counter.

PreviewAttachmentSize
RSS_ticker.qtz36.04 KB

leegrosbauer's picture
Re: Rss Crawler/Ticker

heh. It zips along right quick when I stick the Kineme RSS feed in it. lol. :-)

mehran's picture
Re: Rss Crawler/Ticker

Thank you for the sample.

My problem is with the news ticker. I want to show one news at a time. I don't want them to follow each other. So the way I need is show title and the description, let description scroll and go out of display, then switch to the next article and repeat again.

In your example, description and title will change in middle of movement and it is difficult to know which article it is. To do that I need to have a mechanism for delay, so I can say, show first news and wait until it is finished ( going out of display) and then move to next one. In this case, the trigger could be when the image that shows the description, went out of display area. I have issue with defining that trigger and delay mechanism.

dust's picture
Re: Rss Crawler/Ticker

yeah, the example above was just showing you how to make a 10 second delay before triggering the next article. i payed no attention to the descriptions interpolation, sorry about that, it was late last night. so you basically had your set up right, by feeding a conditional into a counter.

what i did was take your description's interpolation end point and added 1 to the negative value that your maths patch was spitting out. by adding one to the negative end value it makes it so that you are able to evaluate your conditional. for example you want to interpolate from 10 to -10, and your conditional is waiting to evaluate -10 but the your interpolator never hits -10 because the actual end value is really -9.999 or something so your never hitting -10.

now you set the tolerance to something like .0001 or something and theoretically you should have been able to get truth by setting a tolerance. my guess is that the truth your getting with that tolerance doesn't stay true long enough to trigger your counter or your tolerance was not in the bounds of quartz composer float.

so by making the conditionals second value lets say a -9 on a 10 to -10 interpolation it is evaluating true one digit before the crawl ends. at this point you implement your delay to give the text enough time to crawl off the screen. 2 seconds seems to work. the delay is just a stop watch that is triggered when your string width calculation conditional is true. i rounded the values because your messing with the interpolators duration which can change the actual output of a floating point number seeing the interpolators duration is based on the over all average frame rate which can vary from article to article. basically you can figure it like this. a linear interpolation from 0 to 59 at 60fps with a duration of 1 only takes one second to complete.

so i have also made a simple clock that is based on a 1 second looping stop watch that basically counts up seconds-mins-hours-days-weeks etc... this should give you a clearer understanding of how to go about delaying something x amount of seconds or what ever as the counter conditional principle would be applied the same with a delay as with a clock.

PreviewAttachmentSize
counter.qtz30.23 KB
RSS_ticker.qtz19.4 KB

mehran's picture
Re: Rss Crawler/Ticker

Thank you so much for all details explanation, it was really helpful.

There is still one problem here. When a description of an article goes out of window, I need to say stop crawling. To do that I changed the "Crawl Translation" to have a Patch Time, so I can manage when it can start crawling. Basically, when a descriptions goes out of window, it's time to move on to the next article. In the initial composition and also the one that you sent to me, there is no mechanism to reset that. I put a stopwatch for "Crawl Translation" to command when to stop, but I have to force it to start for first article as well. I can't figure it out, there is still something wrong, it works sometime and it doesn't. When you had time please have a look to attached file and see what I did. Thank you.

PreviewAttachmentSize
RSS_ticker_01.qtz20.56 KB

dust's picture
Re: Rss Crawler/Ticker

hmm. I'm typing this from my iPod right now but later I will have a look. I'm a little unclear what your trying to achieve now. You can always send the counter a reset to go back to the first article or incriment or decrement. Your example was automated but if you want it to say stop crawling, you need to be clear with the user. Say something like press the s key to stop crawling or press the positve key to go to next feed. Maybe make the delay longer and pose a question use a logic patch to evaluate. Like if crawl is finished and user presses key + then skip to next feed else repeat feed ? You just need to be clear with what you need this to do. People do not generally write your java script for you on this site

mehran's picture
Re: Rss Crawler/Ticker

I don't need any interaction from user, I just want to put some delay between each news article. Imagine something like screen saver. I the attached file, I managed to stop crawling by putting 0 in duration parameter. It can stop the crawling but as soon as I set duration to specified time, it just crawl from middle of the screen, looks like it doesn't follow start and end value.

PreviewAttachmentSize
RSS_ticker_02.qtz18.07 KB

dust's picture
Re: Rss Crawler/Ticker

here i simplified the logic a bit for you. instead of setting the duration to zero between feeds its better to use constants. so instead of doing math based on the width like your doing its best to use a constant. see if you really want to be calculating a interpolation based on the length of feed you should be using the character count but even then that gets complicated.

so with this i just used a interpolation from 10 to -10 knowing that the description will be out of the screen at -10 i changed the the end value to -20 and put a conditional on -10 to trigger your loading next feed screen. see the interpolator is still going and when it reaches -20 it triggers the multiplexor to switch back the article image and triggers the inc on the counter to load the next feed starting off screen.

this is the simplest solution and is working on your apples rss feed but you might need to tweak the numbers for a twitter feed or something.

PreviewAttachmentSize
rss_crawl.qtz15.26 KB

mehran's picture
Re: Rss Crawler/Ticker

Thank you for suggesting the simple solution, I changed a little bit and now it can handle any feed properly, with out any need to define constant for article location. Instead of character counting I used the width of the image that was made out of article description. I checked with couple of different feeds and looks like it is working properly. The only thing that I used constant for is description duration, this is fine for feeds with almost same amount of characters for description, but if inside a feed we had a small description for an article and at the same feed another article with much more amount of characters, it cause the small article move slowly and the big one move faster than smaller one. I guess it is possible to relate this duration to number of character as well, so duration time could be related some how to number of characters in description of article.

I really appreciate all your help here, it was really helpful for me and I learned a lot from your changes. Thank you

PreviewAttachmentSize
rss_crawl_01.qtz17.74 KB

dust's picture
Re: Rss Crawler/Ticker

cool yeah, its probably best to some math so any feed would work but defiantly making or keeping the duration a constant helps for readability. i would jack up the duration so your feeds are actually readable or publish the port so people can adjust to how fast the can read.

mehran's picture
Re: Rss Crawler/Ticker

That fast duration was only for testing purpose. I just published it as you suggested, just in case if somebody find this crawler useful to use.

Thank you

PreviewAttachmentSize
rss_crawl_02.qtz17.67 KB

dust's picture
Re: Rss Crawler/Ticker

yeah i was testing with a low duration as well. i thought another way to to stop the interpolation is to set the interpolator to external time then use a stop watch as the driving motor of the interpolator in which case you could stop the the stop watch for x seconds then reset and start the stopwatch when a new article index comes down the line.

leon's picture
Re: Rss Crawler/Ticker

Ou yes, certainly useful, thank you both for posting the discussion and examples. Arigato