📜 ⬆️ ⬇️

Small buns for the service Eventr.com

In the topic, I will describe an easy way to slightly improve the Eventr service, not so long ago described in Habré . This service immediately interested me with my idea and I decided to closely monitor its development. And how can you follow without using it? So I transferred all my feeds from GoogleReader to this service and started trying to use it as the main RSS aggregator.
I will not enumerate here everything, in my opinion, children's diseases and mistakes, for this there is a feedback, where I managed to “get bored” fairly with the found bugs or a group on Reform for new ideas.

Immediately emphasize: I have no relation to the service development team. All (two whole) improvements are written by me for personal use. And they are not official decisions of the service.

While waiting for the update of the service, I could not help but write for myself small and convenient improvements.
So what did I do:
  1. Button for the bookmark bar Add to Eventr ;
  2. Selection of tapes and folders with new posts.

Add to eventr

Part one: RSS browser parser.

Desired: Teach your browser to view Eventr.com as an RSS aggregator, where you can submit a feed.

Google Chrome Example

For Mozilla Firefox, I did not find a way. I was looking for a mechanism for editing "applications" for reading RSS, but I did not find it.

For Google Chrome and its standard extension from the Google RSS Subscription Extension itself (from Google) everything turned out to be as simple and transparent as possible: When choosing an aggregator, the last item is Menage ... ( Manage ... )
there you simply create a new item, specify the name of Eventr and write the link template through which you can add a stream.


Where % s will be replaced with the feed address.

Part Two: Eventr himself can search for feeds on the page - we will not interfere.

Initially, I wrote the bookmark code in such a way that the first found feed was selected from the current page and passed to the Eventr, but in the support service, I kindly suggested that the site itself can search for tapes on the selected site / address. Thus, a button was born that calls up a new Eventr window and offers to add a stream from the current open site.
The code is simple and simple, not using hidden moves in browsers.
function (){
f = 'http://eventr.com/stream/discover?url=' + encodeURIComponent(window.location.href);
a = function (){
if (!window.open(f, 'eventr' , 'location=yes,links=no,scrollbars=yes,toolbar=no,width=1024,height=1000' ))
location.href = f;
if (/Firefox/.test(navigator.userAgent)) {
setTimeout(a, 0)
} else {

* This source code was highlighted with Source Code Highlighter .

Although compressing such a small code makes little sense, but still a compressed version:

javascript: (function () {f = 'http: //eventr.com/stream/discover? url =' + encodeURIComponent (window.location.href); a = function () {if (! window.open (f, 'eventr', 'location = yes, links = no, scrollbars = yes, toolbar = no, width = 1024, height = 1000')) location.href = f;}; if (/Firefox/.test(navigator.userAgent )) {setTimeout (a, 0)} else {a ()}}) ()

Those who are too lazy to compare the formatted code with compressed, can copy the formatted, for the browser it does not matter.

If the ribbon on the transferred page is one, then Eventr immediately adds it and displays it.

If the tape was already in the user list, the addition does not occur.

Select unread tapes

A few minutes after starting to use the service, I already wrote in the list of bugs and suggestions in feedback that it would not be bad for tapes to have new posts to somehow highlight against the general background of the list of tapes. To which I was immediately sent a reasonable answer, that in another opinion, they should not stand out, but promised to reflect on this part of the interface. Well, my opinion is not the last resort, on Reformale there was an idea about improving the readability of the site, where this statement was also attached. Therefore, we hope that the developers will take into account this wish, because voted not a few people.

Well, I set myself the task of making for myself a temporary solution. My solution looks like this (on the left - the standard display, on the right after processing):


Again, I did not find anything suitable for Mozilla Firefox, but I honestly searched, tried several different add-ons (now his fans throw tomatoes at me ...), but I didn’t find anything suitable, because if anyone gives a link to the addon that allows you to perform JS -code immediately after loading the page, I will add it to the post.

For Opera, I think, there is not even anything close and there can not be it due to the specific extensions for this browser.

For now - a solution for Google Chrome.
To do this, we need the Personalized Web addon that perfectly allows you to modify the sites being opened. On the add-on description page there is a detailed list of features, so go straight to the point.

Use for URL:
^ http: // (www \.)? eventr.com /.+$

Because the service already uses jQuery, why don't we use it? Let's add the JS-code to the document that will look for items in the feed tree that have the has-new class every time a new page is opened.
< script >
$( document ).ready( function (){
$( '.group li' ).each( function (){
if ($( this ).hasClass( 'has-new' )){
$( 'a:first span' , this ).css( 'color' , '#4D1E1E' ).css( 'font-weight' , 'bold' );
</ script >

* This source code was highlighted with Source Code Highlighter .

The code does not claim to be optimal, I am sure that you can write more elegantly, but I didn’t get a super ninja selector to select only the necessary elements, so I went for a break.

I really hope that soon, with the rollout of service updates, such tricks will no longer be needed. For now - I use. If it is useful to someone else - I will be glad.

Source: https://habr.com/ru/post/101343/

All Articles