“Hojin

Project Setting

{
"f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
"89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
}
\ No newline at end of file
node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/
# macOS
.DS_Store
import React from "react";
import { AsyncStorage } from "react-native";
import Loading from "./Loading";
import axios from "axios";
const API_KEY = "2bf00f660b1a6a3ffeb6e06ac270cce3";
const NAVER_CLIENT_ID = "KqPsntd1hcPJ8FUPBGqN";
const NAVER_CLIENT_SECRET = "0GRb3uya1U";
// const option = {
// query: "겨울왕국"
// };
// request.get(
// {
// uri: "https://openapi.naver.com/v1/search/movie", //xml 요청 주소는 https://openapi.naver.com/v1/search/image.xml
// qs: option,
// headers: {
// "X-Naver-Client-Id": NAVER_CLIENT_ID,
// "X-Naver-Client-Secret": NAVER_CLIENT_SECRET
// }
// },
// function(err, res, body) {
// let json = JSON.parse(body); //json으로 파싱
// console.log(json);
// }
// );
export default class extends React.Component {
state = {
isLoading: true
};
getNaverApi = async () => {
fetch("https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'", {
headers: {
"X-Naver-Client-Id": NAVER_CLIENT_ID,
"X-Naver-Client-Secret": NAVER_CLIENT_SECRET
}
})
.then(response => response.json())
.then(json => {
console.log(json.items[0].image);
});
};
getMovieList = async () => {
axios
.get(
`http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=${API_KEY}&targetDt=20191129`
)
.then(response => {
for (var i = 0; i < 10; i++) {
console.log(
response.data.boxOfficeResult.dailyBoxOfficeList[i].movieNm
);
}
})
.catch(error => {
console.log(error);
});
};
componentDidMount() {
this.getMovieList();
this.getNaverApi();
}
render() {
const { isLoading, temp, condition } = this.state;
return isLoading ? (
<Loading />
) : (
<Weather temp={Math.round(temp)} condition={condition} />
);
}
}
import React from "react";
import { StyleSheet, Text, View, StatusBar } from "react-native";
export default function Loading() {
return (
<View style={styles.container}>
<StatusBar barStyle="dark-content" />
<Text style={styles.text}>Getting the current weather</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-end",
paddingHorizontal: 30,
paddingVertical: 100,
backgroundColor: "#FDF6AA"
},
text: {
color: "#2c2c2c",
fontSize: 30
}
});
{
"expo": {
"name": "movie List",
"slug": "movieList_EXPO",
"privacy": "public",
"sdkVersion": "35.0.0",
"platforms": ["ios", "android", "web"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
}
}
}
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
This diff could not be displayed because it is too large.
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"axios": "^0.19.0",
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-web": "^0.11.7",
"request": "^2.88.0"
},
"devDependencies": {
"babel-preset-expo": "^7.1.0"
},
"private": true
}