~mateo-salta/touch-rss-scope/utfeed1

« back to all changes in this revision

Viewing changes to src/scope/query.cpp

  • Committer: Mateo Salta
  • Date: 2015-02-01 01:04:04 UTC
  • Revision ID: mateo_salta@yahoo.com-20150201010404-oeryfagn2o632a0d
Add Ubuntu feeds, fix icon. Bump to v.5 14.10 framework, and security 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
 
131
131
        sc::Department::SPtr tag_department = sc::Department::create("Top Tags", query(), "Top Tags");
132
132
//////////TAGGGGGGGGGGGGGGGGGGGGGSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
 
133
        sc::Department::SPtr appdev_department = sc::Department::create("Application-Development", query(), "Application-Development");
133
134
        sc::Department::SPtr installation_department = sc::Department::create("Installation", query(), "Installation");
134
135
        sc::Department::SPtr boot_department = sc::Department::create("Boot", query(), "Boot");
135
136
        sc::Department::SPtr unity_department = sc::Department::create("Unity", query(), "Unity");
156
157
                                       au_department});
157
158
        au_department->set_subdepartments({tag_department});
158
159
 
159
 
        tag_department->set_subdepartments({installation_department,
 
160
        tag_department->set_subdepartments({appdev_department,
 
161
                                           installation_department,
160
162
                                           boot_department,
161
163
                                           unity_department,
162
164
                                           wireless_department,
208
210
        ///
209
211
        /// \brief feeds
210
212
        ///
211
 
        Client::Feeds feeds;
 
213
        Client::Furs feeds;
212
214
 
213
215
        //if (query_string.empty()) { //we don't really want it empty on feed finding...
214
216
        if (department == "") { ///DEPARTMENT
428
430
                           }
429
431
                       ///PLAN
430
432
 
 
433
               ///
 
434
              if (department == "Ubuntu") { ///DEPARTMENT
 
435
                      ///CALS
 
436
                      Client::Cals cals;
 
437
 
 
438
                      // If there is no search string...
 
439
                      cals = client_.add_cals("https://www.google.com/calendar/feeds/dno3ip0msg552dei3e3r7m8jl0%40group.calendar.google.com/public/basic", lang_sys, rest_sys);
 
440
                      // Register a category for the
 
441
                      auto cal_cat = reply->register_category("Cal",
 
442
                                                                   _("Ubuntu on Air! Calendar"), "", sc::CategoryRenderer(LAUNCH_TEMPLATE));
 
443
                      // For each of the...
 
444
                      for (const auto &cal : cals.cal) {
 
445
                          // Create a result
 
446
                          sc::CategorisedResult res(cal_cat);
 
447
 
 
448
                          // We must have a URI
 
449
                          res.set_uri(cal.link);
 
450
 
 
451
                          res.set_title(cal.title);
 
452
                          //res.set_art(launch.icon);
 
453
                          // Set the rest of the attributes
 
454
                          res.set_art("http://www.google.com/s2/favicons?domain=" + cal.link);
 
455
                          res["subtitle"] = cal.link;
 
456
                          res["description"] = cal.content;
 
457
                          res["feed"] = ("https://www.google.com/calendar/feeds/dno3ip0msg552dei3e3r7m8jl0%40group.calendar.google.com/public/basic");
 
458
 
 
459
                          // Push the result
 
460
                          if (!reply->push(res)) {
 
461
                              // If we fail to push, it means the query has been cancelled.
 
462
                              // So don't continue;
 
463
                              return;
 
464
                          }
 
465
                          }
 
466
                          }///DEPART
 
467
                      ///CALS
 
468
                      ///
 
469
 
 
470
              ///
 
471
             if (department == "Ubuntu") { ///DEPARTMENT
 
472
                     ///SUMS
 
473
                     Client::Sums sums;
 
474
 
 
475
                     // If there is no search string...
 
476
                     sums = client_.add_sums("http://pipes.yahoo.com/pipes/pipe.run?_id=5bd03dad3b420100acc1c22d29a2204a&_render=rss&googleCalendarUrl=http%3A%2F%2Fsummit.ubuntu.com%2Fuos-1411.ical", lang_sys, rest_sys);
 
477
                     // Register a category for the
 
478
                     auto sum_cat = reply->register_category("Sum",
 
479
                                                                  _("UOS November 2014"), "", sc::CategoryRenderer(LAUNCH_TEMPLATE));
 
480
                     // For each of the...
 
481
                     for (const auto &sum : sums.sum) {
 
482
                         // Create a result
 
483
                         sc::CategorisedResult res(sum_cat);
 
484
 
 
485
                         // We must have a URI
 
486
                         res.set_uri(sum.link);
 
487
 
 
488
                         res.set_title(sum.title);
 
489
                         //res.set_art(launch.icon);
 
490
                         // Set the rest of the attributes
 
491
                         res.set_art("http://www.google.com/s2/favicons?domain=" + sum.link);
 
492
                         res["subtitle"] = sum.publishedDate;
 
493
                         res["description"] = sum.content;
 
494
                         res["feed"] = ("http://pipes.yahoo.com/pipes/pipe.run?_id=5bd03dad3b420100acc1c22d29a2204a&_render=rss&googleCalendarUrl=http%3A%2F%2Fsummit.ubuntu.com%2Fuos-1411.ical");
 
495
 
 
496
                         // Push the result
 
497
                         if (!reply->push(res)) {
 
498
                             // If we fail to push, it means the query has been cancelled.
 
499
                             // So don't continue;
 
500
                             return;
 
501
                         }
 
502
                         }
 
503
                         }///DEPART
 
504
                     ///SUMS
 
505
 
431
506
        ///
432
507
       if (department == "Ubuntu") { ///DEPARTMENT
433
508
               ///LAUNCHS
920
995
                                                /// //
921
996
                                                /// /
922
997
                                                /// /
 
998
                                                ///
 
999
 
 
1000
                                        if (department == "Application-Development") { ///DEPARTMENT
 
1001
                                                ///OMGS
 
1002
                                                Client::Appdevs appdevs;
 
1003
 
 
1004
 
 
1005
 
 
1006
                                                // If there is no search string, get the
 
1007
                                                appdevs = client_.add_appdevs("http://askubuntu.com/feeds/tag/application-development", lang_sys, rest_sys);
 
1008
                                                // Register a category for the
 
1009
                                                auto appdev_cat = reply->register_category("Application-Development",
 
1010
                                                                                             _(""), "", sc::CategoryRenderer(LAUNCH_TEMPLATE));
 
1011
                                                // For each of the forecast days
 
1012
                                                for (const auto &appdev : appdevs.appdev) {
 
1013
                                                    // Create a result
 
1014
                                                    sc::CategorisedResult res(appdev_cat);
 
1015
 
 
1016
                                                    // We must have a URI
 
1017
                                                    res.set_uri(appdev.link);
 
1018
 
 
1019
                                                    res.set_title(appdev.title);
 
1020
                                                    //res.set_art(installation.icon);
 
1021
                                                    // Set the rest of the attributes
 
1022
                                                    res.set_art("http://www.google.com/s2/favicons?domain=" + appdev.link);
 
1023
                                                    res["subtitle"] = appdev.author;
 
1024
                                                    res["date"] = appdev.publishedDate;
 
1025
                                                    res["description"] = appdev.content;
 
1026
                                                    res["feed"] = ("http://askubuntu.com/feeds/tag/application-development");
 
1027
 
 
1028
                                                    // Push the result
 
1029
                                                    if (!reply->push(res)) {
 
1030
                                                        // If we fail to push, it means the query has been cancelled.
 
1031
                                                        // So don't continue;
 
1032
                                                        return;
 
1033
                                                    }
 
1034
                                                    }
 
1035
                                                    }
 
1036
                                                ///OMGS
 
1037
                                                ///
 
1038
 
923
1039
 
924
1040
                                        if (department == "Installation") { ///DEPARTMENT
925
1041
                                                ///OMGS