Beispiel #1
0
        public async Task <List <GoogleSource> > GetSource()
        {
            if (!String.IsNullOrEmpty(profileId))
            {
                DataResource.GaResource.GetRequest request = service.Data.Ga.Get(String.Format("ga:{0}", profileId), "30daysAgo", "today", "ga:sessions,ga:users");
                request.Dimensions = "ga:medium";
                var qq = await request.ExecuteAsync();

                List <GoogleSource> visitors = new List <GoogleSource>();
                foreach (var item in qq.Rows)
                {
                    GoogleSource vv = new GoogleSource();
                    vv.Refferal     = item[0];
                    vv.SessionCount = item[1];
                    vv.Users        = item[2];
                    visitors.Add(vv);
                }
                return(visitors);
                //return qq.TotalResults.ToString();
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
 public SyncPhotos(IGoogleBearerTokenRetriever googleBearerTokenRetriever,
                   LocalSource localSource,
                   GoogleSource googleSource,
                   CollectionSync collectionSync,
                   ILogger <SyncPhotos> logger)
 {
     m_GoogleBearerTokenRetriever = googleBearerTokenRetriever;
     m_LocalSource    = localSource;
     m_GoogleSource   = googleSource;
     m_CollectionSync = collectionSync;
     m_Logger         = logger;
 }
Beispiel #3
0
        public CollectionDiff(LocalSource localSource, GoogleSource googleSource)
        {
            foreach (var localAlbum in localSource.PhotoAlbums)
            {
                var match = googleSource.Albums.SingleOrDefault(g => string.Equals(g.Title, localAlbum.Name, StringComparison.InvariantCultureIgnoreCase));

                if (match == null)
                {
                    NeverSyncedAlbums.Add(localAlbum);
                }
                else if (match.MediaItemsCount != localAlbum.TotalFiles)
                {
                    PartialSyncedAlbums.Add(new LocalGooglePair(localAlbum, match));
                }
                else
                {
                    SameAlbumsCount++;
                }
            }
        }
 public GoogleUrlBuilder(GoogleSource source)
 {
     this.location = new GoogleLocation();
     this.source = source;
 }
Beispiel #5
0
 public GoogleUrlBuilder(GoogleSource source)
 {
     this.location = new GoogleLocation();
     this.source   = source;
 }