“Hojin

Project Setting

1 +{
2 + "f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
3 + "89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +node_modules/**/*
2 +.expo/*
3 +npm-debug.*
4 +*.jks
5 +*.p8
6 +*.p12
7 +*.key
8 +*.mobileprovision
9 +*.orig.*
10 +web-build/
11 +web-report/
12 +
13 +# macOS
14 +.DS_Store
1 +import React from "react";
2 +import { AsyncStorage } from "react-native";
3 +import Loading from "./Loading";
4 +import axios from "axios";
5 +
6 +const API_KEY = "2bf00f660b1a6a3ffeb6e06ac270cce3";
7 +const NAVER_CLIENT_ID = "KqPsntd1hcPJ8FUPBGqN";
8 +const NAVER_CLIENT_SECRET = "0GRb3uya1U";
9 +
10 +// const option = {
11 +// query: "겨울왕국"
12 +// };
13 +
14 +// request.get(
15 +// {
16 +// uri: "https://openapi.naver.com/v1/search/movie", //xml 요청 주소는 https://openapi.naver.com/v1/search/image.xml
17 +// qs: option,
18 +// headers: {
19 +// "X-Naver-Client-Id": NAVER_CLIENT_ID,
20 +// "X-Naver-Client-Secret": NAVER_CLIENT_SECRET
21 +// }
22 +// },
23 +// function(err, res, body) {
24 +// let json = JSON.parse(body); //json으로 파싱
25 +// console.log(json);
26 +// }
27 +// );
28 +
29 +export default class extends React.Component {
30 + state = {
31 + isLoading: true
32 + };
33 + getNaverApi = async () => {
34 + fetch("https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'", {
35 + headers: {
36 + "X-Naver-Client-Id": NAVER_CLIENT_ID,
37 + "X-Naver-Client-Secret": NAVER_CLIENT_SECRET
38 + }
39 + })
40 + .then(response => response.json())
41 + .then(json => {
42 + console.log(json.items[0].image);
43 + });
44 + };
45 + getMovieList = async () => {
46 + axios
47 + .get(
48 + `http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=${API_KEY}&targetDt=20191129`
49 + )
50 + .then(response => {
51 + for (var i = 0; i < 10; i++) {
52 + console.log(
53 + response.data.boxOfficeResult.dailyBoxOfficeList[i].movieNm
54 + );
55 + }
56 + })
57 + .catch(error => {
58 + console.log(error);
59 + });
60 + };
61 + componentDidMount() {
62 + this.getMovieList();
63 + this.getNaverApi();
64 + }
65 + render() {
66 + const { isLoading, temp, condition } = this.state;
67 + return isLoading ? (
68 + <Loading />
69 + ) : (
70 + <Weather temp={Math.round(temp)} condition={condition} />
71 + );
72 + }
73 +}
1 +import React from "react";
2 +import { StyleSheet, Text, View, StatusBar } from "react-native";
3 +
4 +export default function Loading() {
5 + return (
6 + <View style={styles.container}>
7 + <StatusBar barStyle="dark-content" />
8 + <Text style={styles.text}>Getting the current weather</Text>
9 + </View>
10 + );
11 +}
12 +
13 +const styles = StyleSheet.create({
14 + container: {
15 + flex: 1,
16 + justifyContent: "flex-end",
17 + paddingHorizontal: 30,
18 + paddingVertical: 100,
19 + backgroundColor: "#FDF6AA"
20 + },
21 + text: {
22 + color: "#2c2c2c",
23 + fontSize: 30
24 + }
25 +});
1 +{
2 + "expo": {
3 + "name": "movie List",
4 + "slug": "movieList_EXPO",
5 + "privacy": "public",
6 + "sdkVersion": "35.0.0",
7 + "platforms": ["ios", "android", "web"],
8 + "version": "1.0.0",
9 + "orientation": "portrait",
10 + "icon": "./assets/icon.png",
11 + "splash": {
12 + "image": "./assets/splash.png",
13 + "resizeMode": "contain",
14 + "backgroundColor": "#ffffff"
15 + },
16 + "updates": {
17 + "fallbackToCacheTimeout": 0
18 + },
19 + "assetBundlePatterns": ["**/*"],
20 + "ios": {
21 + "supportsTablet": true
22 + }
23 + }
24 +}
1 +module.exports = function(api) {
2 + api.cache(true);
3 + return {
4 + presets: ['babel-preset-expo'],
5 + };
6 +};
This diff could not be displayed because it is too large.
1 +{
2 + "main": "node_modules/expo/AppEntry.js",
3 + "scripts": {
4 + "start": "expo start",
5 + "android": "expo start --android",
6 + "ios": "expo start --ios",
7 + "web": "expo start --web",
8 + "eject": "expo eject"
9 + },
10 + "dependencies": {
11 + "axios": "^0.19.0",
12 + "expo": "^35.0.0",
13 + "react": "16.8.3",
14 + "react-dom": "16.8.3",
15 + "react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
16 + "react-native-web": "^0.11.7",
17 + "request": "^2.88.0"
18 + },
19 + "devDependencies": {
20 + "babel-preset-expo": "^7.1.0"
21 + },
22 + "private": true
23 +}