// Using React Router V3 import { browserHistory } from ‘react-router’; class App extends React.component { componentDidMount() { this.unlisten = browserHistory.listen( location => { if (window.om5678_1234) { window.om5678_1234.reset(); } }); } componentWillUnmount() { this.unlisten(); } render() { return ( ‘…Continue reading
// Using React Router V4 import React from “react”; import { withRouter } from “react-router”; class App extends Component { componentDidMount() { this.unlisten = this.props.history.listen((location, action) => { if (window.om5678_1234) { window.om5678_1234.reset(); } }); } componentWillUnmount() { this.unlisten(); } render()…Continue reading
// Using Vue Router. import Vue from ‘vue’; import Router from ‘vue-router’; Vue.use(Router); const router = new Router ({ // Your vue router settings. }); router.beforeEach((to, from, next) => { if (window.om5678_1234) { window.om5678_1234.reset(); } next(); }); export default router;Continue reading
// Funksjon for å generere en historie basert på OpenAI GPT function generate_story_with_openai($input) { $api_key = ‘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’; // Bytt ut med din faktiske API-nøkkel $url = ‘https://api.openai.com/v1/completions’; $data = [ ‘model’ => ‘text-davinci-004’, // Bruk den GPT-modellen du har tilgang…Continue reading