Browse Source

Displaying hardcoded tweets through json file

rohit.gowda 4 years ago
parent
commit
ab101f8fb6
2 changed files with 162 additions and 79 deletions
  1. 3 2
      app/src/pages/home/home.ts
  2. 159 77
      app/src/pages/home/tweet.json

+ 3 - 2
app/src/pages/home/home.ts

@@ -1,4 +1,5 @@
 import { Component } from "@angular/core";
+import * as twt from './tweet.json';
 import {
   IonicPage,
   NavController,
@@ -34,8 +35,8 @@ export class HomePage {
     const loading = this.loadingCtrl.create();
     // loading.present();
     loading.dismiss();
-    // this.tweets = twt;
-    // console.log('tweets are:',twt);
+    this.tweets = twt;
+    console.log('tweets are:',this.tweets);
     // this.feed
     //   .loadHomeTimeline()
     //   .then(tweets => (this.tweets = tweets))

+ 159 - 77
app/src/pages/home/tweet.json

@@ -1,80 +1,162 @@
-{
-  "created_at": "Wed Sep 25 19:54:41 +0000 2019",
-  "id": 1176948153297362947,
-  "id_str": "1176948153297362947",
-  "full_text": "Fgttgf",
-  "truncated": false,
-  "display_text_range": [
-    0,
-    6
-  ],
-  "entities": {
-    "hashtags": [],
-    "symbols": [],
-    "user_mentions": [],
-    "urls": []
-  },
-  "source": "<a href=\"https://www.tk.informatik.tu-darmstadt.de/de/telecooperation-group/\" rel=\"nofollow\">Private Twitter (TU Darmstadt)</a>",
-  "in_reply_to_status_id": null,
-  "in_reply_to_status_id_str": null,
-  "in_reply_to_user_id": null,
-  "in_reply_to_user_id_str": null,
-  "in_reply_to_screen_name": null,
-  "user": {
-    "id": 1176099783947235328,
-    "id_str": "1176099783947235328",
-    "name": "Thesis test",
-    "screen_name": "test_thesis",
-    "location": "",
-    "description": "",
-    "url": null,
+[
+  {
+    "created_at": "Wed Sep 25 19:54:41 +0000 2019",
+    "id": 1176948153297362947,
+    "id_str": "1176948153297362947",
+    "full_text": "Fgttgf",
+    "truncated": false,
+    "display_text_range": [
+      0,
+      6
+    ],
     "entities": {
-      "description": {
-        "urls": []
-      }
+      "hashtags": [],
+      "symbols": [],
+      "user_mentions": [],
+      "urls": []
+    },
+    "source": "<a href=\"https://www.tk.informatik.tu-darmstadt.de/de/telecooperation-group/\" rel=\"nofollow\">Private Twitter (TU Darmstadt)</a>",
+    "in_reply_to_status_id": null,
+    "in_reply_to_status_id_str": null,
+    "in_reply_to_user_id": null,
+    "in_reply_to_user_id_str": null,
+    "in_reply_to_screen_name": null,
+    "user": {
+      "id": 1176099783947235328,
+      "id_str": "1176099783947235328",
+      "name": "Thesis test",
+      "screen_name": "test_thesis",
+      "location": "",
+      "description": "",
+      "url": null,
+      "entities": {
+        "description": {
+          "urls": []
+        }
+      },
+      "protected": false,
+      "followers_count": 0,
+      "friends_count": 0,
+      "listed_count": 0,
+      "created_at": "Mon Sep 23 11:43:41 +0000 2019",
+      "favourites_count": 0,
+      "utc_offset": null,
+      "time_zone": null,
+      "geo_enabled": false,
+      "verified": false,
+      "statuses_count": 2,
+      "lang": null,
+      "contributors_enabled": false,
+      "is_translator": false,
+      "is_translation_enabled": false,
+      "profile_background_color": "F5F8FA",
+      "profile_background_image_url": null,
+      "profile_background_image_url_https": null,
+      "profile_background_tile": false,
+      "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
+      "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
+      "profile_link_color": "1DA1F2",
+      "profile_sidebar_border_color": "C0DEED",
+      "profile_sidebar_fill_color": "DDEEF6",
+      "profile_text_color": "333333",
+      "profile_use_background_image": true,
+      "has_extended_profile": false,
+      "default_profile": true,
+      "default_profile_image": true,
+      "following": false,
+      "follow_request_sent": false,
+      "notifications": false,
+      "translator_type": "none"
     },
-    "protected": false,
-    "followers_count": 0,
-    "friends_count": 0,
-    "listed_count": 0,
-    "created_at": "Mon Sep 23 11:43:41 +0000 2019",
-    "favourites_count": 0,
-    "utc_offset": null,
-    "time_zone": null,
-    "geo_enabled": false,
-    "verified": false,
-    "statuses_count": 2,
-    "lang": null,
-    "contributors_enabled": false,
-    "is_translator": false,
-    "is_translation_enabled": false,
-    "profile_background_color": "F5F8FA",
-    "profile_background_image_url": null,
-    "profile_background_image_url_https": null,
-    "profile_background_tile": false,
-    "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
-    "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
-    "profile_link_color": "1DA1F2",
-    "profile_sidebar_border_color": "C0DEED",
-    "profile_sidebar_fill_color": "DDEEF6",
-    "profile_text_color": "333333",
-    "profile_use_background_image": true,
-    "has_extended_profile": false,
-    "default_profile": true,
-    "default_profile_image": true,
-    "following": false,
-    "follow_request_sent": false,
-    "notifications": false,
-    "translator_type": "none"
+    "geo": null,
+    "coordinates": null,
+    "place": null,
+    "contributors": null,
+    "is_quote_status": false,
+    "retweet_count": 0,
+    "favorite_count": 0,
+    "favorited": false,
+    "retweeted": false,
+    "lang": "tl"
   },
-  "geo": null,
-  "coordinates": null,
-  "place": null,
-  "contributors": null,
-  "is_quote_status": false,
-  "retweet_count": 0,
-  "favorite_count": 0,
-  "favorited": false,
-  "retweeted": false,
-  "lang": "tl"
-}
+  {
+    "created_at": "Wed Sep 25 19:54:41 +0000 2019",
+    "id": 1176948153297362947,
+    "id_str": "1176948153297362947",
+    "full_text": "Fgttgf",
+    "truncated": false,
+    "display_text_range": [
+      0,
+      6
+    ],
+    "entities": {
+      "hashtags": [],
+      "symbols": [],
+      "user_mentions": [],
+      "urls": []
+    },
+    "source": "<a href=\"https://www.tk.informatik.tu-darmstadt.de/de/telecooperation-group/\" rel=\"nofollow\">Private Twitter (TU Darmstadt)</a>",
+    "in_reply_to_status_id": null,
+    "in_reply_to_status_id_str": null,
+    "in_reply_to_user_id": null,
+    "in_reply_to_user_id_str": null,
+    "in_reply_to_screen_name": null,
+    "user": {
+      "id": 1176099783947235328,
+      "id_str": "1176099783947235328",
+      "name": "Thesis test",
+      "screen_name": "test_thesis",
+      "location": "",
+      "description": "",
+      "url": null,
+      "entities": {
+        "description": {
+          "urls": []
+        }
+      },
+      "protected": false,
+      "followers_count": 0,
+      "friends_count": 0,
+      "listed_count": 0,
+      "created_at": "Mon Sep 23 11:43:41 +0000 2019",
+      "favourites_count": 0,
+      "utc_offset": null,
+      "time_zone": null,
+      "geo_enabled": false,
+      "verified": false,
+      "statuses_count": 2,
+      "lang": null,
+      "contributors_enabled": false,
+      "is_translator": false,
+      "is_translation_enabled": false,
+      "profile_background_color": "F5F8FA",
+      "profile_background_image_url": null,
+      "profile_background_image_url_https": null,
+      "profile_background_tile": false,
+      "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
+      "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
+      "profile_link_color": "1DA1F2",
+      "profile_sidebar_border_color": "C0DEED",
+      "profile_sidebar_fill_color": "DDEEF6",
+      "profile_text_color": "333333",
+      "profile_use_background_image": true,
+      "has_extended_profile": false,
+      "default_profile": true,
+      "default_profile_image": true,
+      "following": false,
+      "follow_request_sent": false,
+      "notifications": false,
+      "translator_type": "none"
+    },
+    "geo": null,
+    "coordinates": null,
+    "place": null,
+    "contributors": null,
+    "is_quote_status": false,
+    "retweet_count": 0,
+    "favorite_count": 0,
+    "favorited": false,
+    "retweeted": false,
+    "lang": "tl"
+  }
+]